-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Fix invalid relativedelta_kwds #19398
New issue
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
Changes from all commits
bd7f8cf
2010dbb
51ec9ed
7a57cab
2f2df38
aeb3e87
fe882f1
06efb41
8e947fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,6 +158,54 @@ def __add__(date): | |
date + BDay(0) == BDay.rollforward(date) | ||
|
||
Since 0 is a bit weird, we suggest avoiding its use. | ||
|
||
Parameters | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correct, can you separate this into 2 subsections and make clear the different behavior (via an example)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is an issue to revisit this (IOW we should have 2 different offsets for this different behaviors) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. The docstring is already pretty big and likely to get much bigger. Is there somewhere else part of it should go?
Yah, IIRC there was a suggestion to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't make it long, make it wide instead (its a bit non-standard ok)
|
||
---------- | ||
n : int, default 1 | ||
The number of time periods the offset represents. | ||
normalize : bool, default False | ||
Whether to round the result of a DateOffset addition down to the | ||
previous midnight. | ||
**kwds | ||
Temporal parameter that add to or replace the offset value. | ||
|
||
Parameters that **add** to the offset (like Timedelta): | ||
|
||
- years | ||
- months | ||
- weeks | ||
- days | ||
- hours | ||
- minutes | ||
- seconds | ||
- microseconds | ||
- nanoseconds | ||
|
||
Parameters that **replace** the offset value: | ||
|
||
- year | ||
- month | ||
- day | ||
- weekday | ||
- hour | ||
- minute | ||
- second | ||
- microsecond | ||
- nanosecond | ||
|
||
See Also | ||
-------- | ||
dateutil.relativedelta.relativedelta | ||
|
||
Examples | ||
-------- | ||
>>> ts = pd.Timestamp('2017-01-01 09:10:11') | ||
>>> ts + DateOffset(months=3) | ||
Timestamp('2017-04-01 09:10:11') | ||
|
||
>>> ts = pd.Timestamp('2017-01-01 09:10:11') | ||
>>> ts + DateOffset(month=3) | ||
Timestamp('2017-03-01 09:10:11') | ||
""" | ||
_params = cache_readonly(BaseOffset._params.fget) | ||
_use_relativedelta = False | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically this is an api change, IOW week & milliseconds cannot be passed anymore (maybe add this PR number somwhere)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot you're right.