-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG/API: master issue for resample on DST days #5172
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
cc @rockg can you take a look? |
A little background...what is done behind the scenes is to make a DatetimeIndex that has the passed frequency that forms the basis for the resample. In this case, it's a daily curve. Unfortunately, the AmbiguousTime s is related to what we've seen with other things (e.g., #5175). Basically your date is normalized (_adjust_dates_anchored in tseries.resample), but it returns 2012-11-04 00:00:00-05:00 when it should return 2012-11-04 00:00:00-04:00. The dates are normalized using datetime.replace() by setting components to zero, but the tzoffset does not change. I believe the fix is to localize. Let me do some digging on possible solutions. @dflatow, in the meantime a simple fix would be to use UTC or not localize at all. |
My workaround is to use a groupby instead of resample (the timezones matter for the analysis I'm doing - so UTC won't work). Any word on a fix though? |
Good news is that I have all of these figured out. One issue I'm having is related to #8601. Basically when you take a time in non-DST and apply the +MS rule, it goes to the last hour of the month because of DST (see #5175) for more explanation. In that commit the logic was applied to DateOffset, but all the other offsets need to remove the timezone, apply the offset, and then put it back. This seems pretty ugly and I'm looking for suggestions to handle this in a uniform way rather than duplicating the logic for every single offset.
The below basically needs to be added to
The other issue was caused by Another problem is that Wrong:
Right:
|
I guess the removal of |
closed by #9623 |
raises a AmbiguousTimeError even though datetime(2012, 11, 4, 23, 0, 0) is not ambiguous.
The text was updated successfully, but these errors were encountered: