-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: BDay() offsetting not behaving as expected #38324
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
BUG: BDay() offsetting not behaving as expected #38324
Conversation
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.
Is there a more concise way to construct the expected result?
69d293a
to
e420c24
Compare
Hello @arw2019, |
1bf0549
to
63e97b2
Compare
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.
lgtm other than comment
idx = pd.date_range("2010/02/01", "2010/02/15", freq="6H") | ||
t1 = idx + BDay(offset=pd.Timedelta(3, unit="H")) | ||
|
||
expected = DatetimeIndex( |
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.
i don't feel strongly about this but is there not a more concise way to generate this
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.
Reducing the date range seems to be the way to go here. Maybe extend the freq too?
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.
Done
63e97b2
to
2adaf77
Compare
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.
looks fine if you can fixup the imports & ping on green.
@@ -19,6 +19,7 @@ | |||
from pandas.compat.numpy import np_datetime64_compat | |||
from pandas.errors import PerformanceWarning | |||
|
|||
import pandas as pd |
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.
import are all crazy here, instead of adding can you just do
from pandas import DatetimeIndex, date_range, Series, read_pickle
and remove the other references
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.
Done
f6b3e12
to
96275af
Compare
96275af
to
d20e166
Compare
There is only a failing travis check but it does not seem to come from the pr changes. Is there a way to re-rerun only this check? |
thanks @theoniko |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff