-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: get_loc / get_indexer with NaT and tz-aware DatetimeIndex #32572
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
I suppose the title is wrong? |
Ah, sorry, I see that it is the message in the error (but still, that's not the actual issue I think). Previously in 0.25.0, there was a different (but also not good) error: "TypeError: bad operand type for abs(): 'NaTType'" |
It seems that somewhere in the code, the datetime index is converted to object dtype, which leads to having an object dtype array with timestamps (and this gives the error about not being able to subtract a ndarray). This happens here: pandas/pandas/core/indexes/base.py Lines 2947 to 2952 in 76a1710
and we end up there, because the dtype of the index is not equal to the index of the target (dattime64[ns, tz] vs datetime64[ns]). |
take |
The 1301 seems weird to me |
Code Sample, a copy-pastable example if possible
Problem description
pd.NaT
is NaT regardless of timezone.Expected Output
Output of
pd.show_versions()
pandas 1.1.0.dev0+725.gae79bb23c
The text was updated successfully, but these errors were encountered: