We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a DateOffset works for single Timestamps and for DatetimeIndex, but fails on a Series:
In [132]: s = pd.Series(pd.date_range('2012-01-01', periods=3)) In [133]: s Out[133]: 0 2012-01-01 1 2012-01-02 2 2012-01-03 dtype: datetime64[ns] In [134]: s[0] + pd.DateOffset(months=2) Out[134]: Timestamp('2012-03-01 00:00:00') In [135]: pd.DatetimeIndex(s) + pd.DateOffset(months=2) Out[135]: DatetimeIndex(['2012-03-01', '2012-03-02', '2012-03-03'], dtype='datetime64[ns]', freq='D', tz=None) In [136]: s + pd.DateOffset(months=2) --------------------------------------------------------------------------- TypeError: cannot use a non-absolute DateOffset in datetime/timedelta operations [<DateOffset: kwds={'months': 2}>]
The text was updated successfully, but these errors were encountered:
+1. Also it's nice if other offset methods like onOffset can accept list-likes.
onOffset
Sorry, something went wrong.
closed by #10744
No branches or pull requests
Adding a DateOffset works for single Timestamps and for DatetimeIndex, but fails on a Series:
The text was updated successfully, but these errors were encountered: