So I have this column in a dataframe that has 4896 rows of datatimes in this shape:
2018-10-24
2014-04-10
2008-05-21
...
And I would like to transform or convert this data to years only (like 2018.15) -> convert the day and month to year time and have only the years!
How can I do so?? Thank you so much!!
In: 2018-10-24
Out: 2018.56 (for example)
Using just base Python (as you didn't specify that you have a pandas dataframe - pandas has specific functions to perform calculations with datetime objects):
Sample output: