-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
tz-aware DatetimeIndex intersection raises AttributeError when values are the same but tz differs #24362
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
It looks like the issue here is that, initially, the DTIs are not equal nor are their dtypes because of the different timezones, so they both converted to pandas/pandas/core/indexes/base.py Line 2388 in 08c920e
This actually starts in the intersection method for DTI, but gets dropped into the Is the expected behavior that, in this case of the intersection, the DTIs are considered equal if the underlying indices are equal, regardless of timezone? If so, then we can make a change to the equality check in the DTI intersection method. The other option I see is to return an |
for other intersection-like operations with mixed timezones we convert to UTC (in particular im thinking of |
or even convert
i.e. we get an object index of Timestamps that are all the same tz |
This now returns an object-dtype Index. The analogous union also returns object dtype, but has a deprecation saying it will be UTC in a future version. We probably should do the same for all setops right? |
If the values differ, no error is raised
The text was updated successfully, but these errors were encountered: