-
-
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 6 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 |
---|---|---|
|
@@ -182,6 +182,49 @@ 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) | ||
normalize : bool (default False) | ||
|
||
Parameters that ADD to the offset (like Timedelta) | ||
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. @TomAugspurger @jorisvandenbossche will this work formatting wise? (prob needs even more in this doc-string, but this is a good start) 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. It will not work formatting wise for sphinx / online docs, I think (should try out to be sure, but I think numpydoc does not accept custom sections) 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. Alternative would be to do like (but then with all options listed where I put
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. I think that recent numpydocs raise if there are extra sections, so this won't work. |
||
-------------------------------------------------- | ||
years : int or None | ||
months : int or None | ||
weeks : int or None | ||
days : int or None | ||
hours : int or None | ||
minutes : int or None | ||
seconds : int or None | ||
microseconds : int or None | ||
nanoseconds : int or None | ||
|
||
Parameters that REPLACE the offset value | ||
---------------------------------------- | ||
year : int or None | ||
month : int or None | ||
day : int or None | ||
weekday : int or None | ||
hour : int or None | ||
minute : int or None | ||
second : int or None | ||
microsecond : int or None | ||
nanosecond : int or None | ||
|
||
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') | ||
|
||
See Also | ||
-------- | ||
dateutil.relativedelta.relativedelta | ||
""" | ||
_use_relativedelta = False | ||
_adjust_dst = 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.