Reputation: 13
Why does the following code produce the same results?
Is there a way to subtract date from pandas TimeStamp?
print s['ADM.DT'] + pd.DateOffset(month=2)
print s['ADM.DT'] - pd.DateOffset(month=2)
s['ADM.DT'] is pandas.tslib.Timestamp object.
Upvotes: 1
Views: 4928
Reputation: 76
If you use
pd.DateOffset(month=2)
It shifts the Date to the second month of the year. If you want to shift the date for 2 months you have to use:
pd.DateOffset(months=2)
Upvotes: 3