-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Difficulties with selecting from numpy.datetime64[ns] dimensions #7207
Comments
Update: I was mistaken about the nature of the issue. I can load someone else's data with a datetime64[ns] dimension and select from it just fine. Meanwhile, I cannot select from my DataArray, even when I have replaced the datetime64[ns] dimension
|
Okay, it gets even weirder. This does not work:
This does:
I am baffled. |
Figured it out. Somehow I got my hands on a piece of data where the timestamps are ever-so-slightly non-monotonic. 2 of the 50k data points are out of order. That makes this a duplicate of #5012 and pandas #42331. Closing this, since those are still open. I would never have figured out what the problem was from the error message 😢, but that's a pandas issue. Sorry for the confusion. |
What is your issue?
I have a DataArray ("
spgs
") containing time-frequency data, with atime
dimension of dtypenumpy.datetime64[ns]
. I used to be able to select using:None of these work after upgrading to v2022.10.0. The first method yields:
The second two methods yield:
Interestingly, this works:
This does not:
I filed this as an issue and not a bug, because from reading other issues here and over at pandas, it seems like this may be an unintended consequence of changes to Datetime/Timestamp handling, especially within pandas, rather than a bug with xarray per se. This is supported by the fact that downgrading xarray to 2022.9.0, without touching other dependencies (e.g. pandas), does not restore the old behavior.
The text was updated successfully, but these errors were encountered: