-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Period(weekend_date, 'B')
returns Monday's Period
#10575
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
Thanks for the report! Internally it uses
|
Is there a reason why it creates the next valid date rather than raising? While we could add a check in |
I'm not sure whether there is a background of current @jreback @bjonen @cancan101 What do you think, |
@jreback @bjonen @cancan101, gentle follow up to @sinhrks's comment: do you have any thoughts here? |
asof
seeks forward rather than backwards on PeriodIndexPeriod(weekend_date, 'B')
returns Monday's Period
This hit us again today - @jreback do you have a view here? |
Well, you have to have a policy for what to happend when you pass a non-supported freq to your frequency based So I think |
OK. I agree with you for converting frequencies. The concept of business days is a bit different - they have gaps. (I can't think of any other examples beyond business hours and some fanciful ones such as 'summer months'.) So I don't think there's a concept of a business day representation of Saturday, while there is a month representation of '2010-01-01', or day representation of '2010-01'. Although it may be that I'm alone in this view! If anyone else has thoughts + there's any consensus, happy to do a PR. |
Period with "B" frequency is deprecated now so not sure if there are any action items here so closing |
The asof docs state that the method should return the most recent label up to and including the passed label. For period indexes, this doesn't seem to be happening - if I supply a period of a weekend date to a weekday series, it returns the Monday, rather than the Friday.
If I do the same on a DatetimeIndex, it behaves as expected
The text was updated successfully, but these errors were encountered: