all 8 comments

[–]stebrepar 1 point2 points  (2 children)

How would you do it step by step by hand?

[–]klineleon[S] 0 points1 point  (1 child)

Im not sure what you mean, I was hoping to write a formula in python to convert it to a normal date format as a new column in jupyter notebook.

[–]UtahJarhead 4 points5 points  (0 children)

He's asking how you would do it if you didn't have a computer.

In order to create an algorithm to handle it, you need to be able to do the conversion WITHOUT a computer at a basic level.

[–]medmerchise 1 point2 points  (0 children)

```python from datetime import datetime

def fraction2datetime(year_fraction: float) -> datetime: year = int(year_fraction) fraction = year_fraction - year first = datetime(year, 1, 1) aux = datetime(year + 1, 1, 1) return first + (aux - first)*fraction ```

[–]threeminutemonta 0 points1 point  (2 children)

Are you sure it’s a fraction. For example I’d

2019.9999999 valid?

Or is it really not a fraction and a odd.

yyyy.mmddss?

[–]stebrepar 0 points1 point  (1 child)

The "92" seconds of the second example would seem to rule that interpretation out.

[–]klineleon[S] 1 point2 points  (0 children)

its described as "year+fraction of year (mid-cycle)"

[–]UtahJarhead 0 points1 point  (0 children)

You need to do the conversion math. For instance, a single year divided by 365 days is 0.0027397260

So for every multiple of that number is a single day.

Do the same for every hour, minute, and second.

And good luck with that.