issue_comments: 241033630
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/issues/975#issuecomment-241033630 | https://api.github.com/repos/pydata/xarray/issues/975 | 241033630 | MDEyOklzc3VlQ29tbWVudDI0MTAzMzYzMA== | 10194086 | 2016-08-19T14:28:39Z | 2016-08-19T14:29:40Z | MEMBER | I tried to look into the logic of decoding datetimes and I am not sure I got it. So the dtype of the dates should be:
(Is it ever a The necessary conversion seems to be determined lazily (which may be the core of my problem above), Try this: ``` import xarray as xr import numpy as np units = 'days since 1850-01-01 00:00:00' dates = np.arange(850) * 365 dta = xr.conventions.DecodedCFDatetimeArray(dates, units) dta[0:1] # a datetime64[ns] object dta[-1] # a datetime.datetime object dta[:] # a datetime.datetime object ``` However, when I load these dates from a netCDF file (see the example in the first post) it results in an error. (Thus, the behavior is not exactly the same as when using Another (or the same) problem is that in Here: (https://github.com/pydata/xarray/blob/master/xarray/conventions.py, line 375) |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
171956399 |