home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 46756880

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
46756880 MDU6SXNzdWU0Njc1Njg4MA== 267 can't use datetime or pandas datetime to index time dimension 291576 closed 0     6 2014-10-24T16:28:49Z 2014-10-28T04:15:04Z 2014-10-28T04:15:04Z CONTRIBUTOR      

Consider the following:

```

c <xray.DataArray 'SPD' (time: 2216)> array([ 9., 6., 6., ..., 10., 5., 3.], dtype=float32) Coordinates: latitude float32 64.833 elevation float32 137.5 longitude float32 -147.6 * time (time) datetime64[ns] 2013-01-01T11:15:00 ... Attributes: units: miles per hour c.sel(time='2013-01-01') <xray.DataArray 'SPD' (time: 13)> array([ 9., 6., 6., 1., nan, 1., nan, 2., 1., 1., 1., 1., 2.], dtype=float32) Coordinates: latitude float32 64.833 elevation float32 137.5 longitude float32 -147.6 * time (time) datetime64[ns] 2013-01-01T11:15:00 ... Attributes: units: miles per hour c.sel(time=datetime(2013, 1, 1)) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nas/home/broot/centos6/lib/python2.7/site-packages/xray-0.3.1.dev_ad43f0b-py2.7.egg/xray/core/dataarray.py", line 495, in sel return self.isel(**indexing.remap_label_indexers(self, indexers)) File "/nas/home/broot/centos6/lib/python2.7/site-packages/xray-0.3.1.dev_ad43f0b-py2.7.egg/xray/core/indexing.py", line 145, in remap_label_indexers for dim, label in iteritems(indexers)) File "/nas/home/broot/centos6/lib/python2.7/site-packages/xray-0.3.1.dev_ad43f0b-py2.7.egg/xray/core/indexing.py", line 145, in <genexpr> for dim, label in iteritems(indexers)) File "/nas/home/broot/centos6/lib/python2.7/site-packages/xray-0.3.1.dev_ad43f0b-py2.7.egg/xray/core/indexing.py", line 129, in convert_label_indexer indexer = index.get_loc(np.asscalar(label)) File "/nas/home/broot/centos6/lib/python2.7/site-packages/pandas/tseries/index.py", line 1280, in get_loc return self._engine.get_loc(stamp) File "index.pyx", line 519, in pandas.index.DatetimeEngine.get_loc (pandas/index.c:9229) File "index.pyx", line 544, in pandas.index.DatetimeEngine.get_loc (pandas/index.c:9018) KeyError: Timestamp('2013-01-01 00:00:00+0000', tz='UTC') ```

The same thing happens if I do a pd.to_datetime() first.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/267/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 6 rows from issue in issue_comments
Powered by Datasette · Queries took 0.585ms · About: xarray-datasette