home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 388662640

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/2127#issuecomment-388662640 https://api.github.com/repos/pydata/xarray/issues/2127 388662640 MDEyOklzc3VlQ29tbWVudDM4ODY2MjY0MA== 6628425 2018-05-13T23:07:15Z 2018-05-13T23:07:15Z MEMBER

It's confusing to me, because I don't see where NumPy is getting years or months metadata from the datetime.timedelta objects formed by np.diff(dates): In [12]: np.diff(dates) Out[12]: array([datetime.timedelta(31), datetime.timedelta(28), datetime.timedelta(31), datetime.timedelta(30), datetime.timedelta(31), datetime.timedelta(30), datetime.timedelta(31), datetime.timedelta(31), datetime.timedelta(30), datetime.timedelta(31), datetime.timedelta(30), datetime.timedelta(31), datetime.timedelta(31), datetime.timedelta(28), datetime.timedelta(31), datetime.timedelta(30), datetime.timedelta(31), datetime.timedelta(30), datetime.timedelta(31), datetime.timedelta(31), datetime.timedelta(30), datetime.timedelta(31), datetime.timedelta(30)], dtype=object) Unlike np.timedelta64 objects, datetime.timedelta objects cannot be composed of units which have a varying length depending on the year (the coarsest internal resolution is days). The problem seems to occur only after calling np.unique; maybe the solution is to do the type conversion before calling np.unique? In [19]: np.unique(np.diff(dates).astype('timedelta64[ns]')) Out[19]: array([2419200000000000, 2592000000000000, 2678400000000000], dtype='timedelta64[ns]')

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