Skip to content
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

Supporting shifting by business days in DateOffset's constructor #10903

Closed
1pakch opened this issue Aug 25, 2015 · 1 comment
Closed

Supporting shifting by business days in DateOffset's constructor #10903

1pakch opened this issue Aug 25, 2015 · 1 comment
Labels

Comments

@1pakch
Copy link

1pakch commented Aug 25, 2015

Now it is not possible to create a DateOffset which would incorporate shifting by a certain number of business days in addition to any other offset rules. In my view, it would be useful to include a bdays argument which would act similarly to days parameter.

NOTE: It is also impossible to create such a DateOffset indirectly via summation DateOffset(hour=2) + BDay() since DateOffsets are currently not summable as discussed in #10902.

@jreback
Copy link
Contributor

jreback commented Aug 26, 2015

So this works

In [2]: Timestamp('20130101') + pd.offsets.DateOffset(hours=2) + pd.offsets.BDay(1)
Out[2]: Timestamp('2013-01-02 02:00:00')

This doesn't handle business days but is much simpler.

In [4]: Timestamp('20130101') + pd.Timedelta('1 day 2 hours')
Out[4]: Timestamp('2013-01-02 02:00:00')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants