Wednesday, 21 August 2013

How to directly use Pandas Date-time index in calculations?

How to directly use Pandas Date-time index in calculations?

I have the following code that works:
table['CALC_DOM']=table.index
table['CALC_DOM']=table['END_DATE']-['CALC_DOM']
should be a better way to directly convert from table.index? like:
table['CALC_DOM']=table.index
table['CALC_DOM']=table['END_DATE']-(table.index())
I have tried using table.index.get_values and
table.index.date
and all I get is TypeError: incompatible type [object] for a
datetime/timedelta operation

No comments:

Post a Comment