In [1]:
from ahh import exp, era

In [2]:
dts = exp.arr_dt()
dts # reference


Out[2]:
DatetimeIndex(['2016-02-28', '2016-02-29', '2016-03-01', '2016-03-02',
               '2016-03-03', '2016-03-04', '2016-03-05', '2016-03-06',
               '2016-03-07', '2016-03-08', '2016-03-09', '2016-03-10',
               '2016-03-11', '2016-03-12', '2016-03-13'],
              dtype='datetime64[ns]', freq='D')

In [3]:
era.shift_months(dts, 3) # shift datetime array 3 months ahead


Out[3]:
DatetimeIndex(['2016-05-28', '2016-05-29', '2016-06-01', '2016-06-02',
               '2016-06-03', '2016-06-04', '2016-06-05', '2016-06-06',
               '2016-06-07', '2016-06-08', '2016-06-09', '2016-06-10',
               '2016-06-11', '2016-06-12', '2016-06-13'],
              dtype='datetime64[ns]', freq=None)

In [4]:
era.shift_months(dts[0], -1) # shift single datetime 1 month behind


Out[4]:
Timestamp('2016-01-28 00:00:00', freq='D')

In [ ]: