issues: 386596872
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
386596872 | MDU6SXNzdWUzODY1OTY4NzI= | 2587 | DataArray constructor still coerces to np.datetime64[ns], not cftime in 0.11.0 | 13662783 | open | 0 | 3 | 2018-12-02T20:34:36Z | 2022-04-18T16:06:12Z | CONTRIBUTOR | Code Sample```python import xarray as xr import numpy as np from datetime import datetime time = [np.datetime64(datetime.strptime("10000101", "%Y%m%d"))] print(time[0]) print(np.dtype(time[0])) da = xr.DataArray(time, ("time",), {"time":time})
print(da)
<xarray.DataArray (time: 1)> array(['2169-02-08T23:09:07.419103232'], dtype='datetime64[ns]') Coordinates: * time (time) datetime64[ns] 2169-02-08T23:09:07.419103232 ``` Problem descriptionI was happy to see
However, it seems that the DataArray constructor does not use Expected OutputI think I'd expect (But perhaps this was already on your radar, and am I just a little too eager!) Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2587/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |