I just cant find the answer and I know pandas eats problems like this for desert.
I have a datetime index
and want to know its length, in years:
idx=pd.date_range('2011-07-03', '2015-07-10')
expected output:
4.0191 years (4 years and 7 days)
If I do:
idx[0]-idx[-1]
I get an output in days
, but id like it in years
Sorry: couldn't locate on panads
docs