issues: 1421180629
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1421180629 | I_kwDOAMm_X85UtX7V | 7207 | Difficulties with selecting from numpy.datetime64[ns] dimensions | 4753005 | closed | 0 | 3 | 2022-10-24T17:35:01Z | 2022-10-24T22:45:36Z | 2022-10-24T22:45:36Z | NONE | What is your issue?I have a DataArray (" Select using datetime stringsspgs.sel(time=slice("2022-10-13T09:00:00", "2022-10-13T21:00:00") Select using Timestamp objectsrng = tuple(pd.to_datetime(x) for x in ["2022-10-13T09:00:00", "2022-10-13T21:00:00"])
spgs.sel(time=slice(rng))
# Select using numpy.datetime64[ns] objects, such that rng[0].dtype == spgs.time.values.dtype
rng = tuple(pd.to_datetime(["2022-10-13T09:00:00", "2022-10-13T21:00:00"]).values)
spg.sel(time=slice(rng))
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. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7207/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |