home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 369974885

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/1952#issuecomment-369974885 https://api.github.com/repos/pydata/xarray/issues/1952 369974885 MDEyOklzc3VlQ29tbWVudDM2OTk3NDg4NQ== 1217238 2018-03-02T16:34:07Z 2018-03-02T16:34:07Z MEMBER

Thanks for the clear report!

This seems to boil down to an issue with xarray.core.dtypes.promote_dtype: ``` In [4]: from xarray.core import dtypes

In [5]: import numpy as np

In [7]: dtypes.maybe_promote(np.dtype('timedelta64[ns]')) Out[7]: (dtype('float64'), nan)

In [9]: dtypes.maybe_promote(np.dtype('datetime64[ns]')) Out[9]: (dtype('<M8[ns]'), numpy.datetime64('NaT')) ```

The source problem seems to be that numpy consider timedelta64 an integer subclass (?!?): In [12]: issubclass(np.timedelta64, np.integer) Out[12]: True

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  301795163
Powered by Datasette · Queries took 76.906ms · About: xarray-datasette