-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BDay offset behaviour vs docs & implementation #10978
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
Comments
The doc-string of
|
the problem is not with 0th day but with 1th and this is the part of the doc that is confusing : If the date does not start on a valid date, first it is moved to a valid date. so you would expect to have pd.Timestamp('20150830')+BDay(1) to add 1 BD after its moved to a valid BD and its not. |
this has been this way for quite some time, eg.. I think since this was written. so will reopen for some comments cc @sinhrks |
It's kind of inconsistent with the
But I also feel like the ship may have sailed - I believe all of the other anchored offsets work like this too:
|
the period transform is more like:
so actually ok with that. I think this could use some docs expanding on exactly this. |
It is related to #10575, whether business day should implicitly anchor to the next valid date. CC @MaximilianR |
As far as the |
OK, we crossed there @sinhrks. Great minds think alike (but fools seldom differ?) |
apologies if this has already been raised but couldn't find an answer.
from the docs :
DateOffsets can be created to move dates forward a given number of valid dates. For example, Bday(2) can be added to a date to move it two business days forward. If the date does not start on a valid date, first it is moved to a valid date.
pd.Timestamp('20150830')+BDay(0) == pd.Timestamp('20150830')+BDay(1) is True
it doesn't move it first to a valid date and the code seem to confirm that. not sure what's the intended behaviour here but would be great to clarify. thanks in advance.
The text was updated successfully, but these errors were encountered: