home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 77984506

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/364#issuecomment-77984506 https://api.github.com/repos/pydata/xarray/issues/364 77984506 MDEyOklzc3VlQ29tbWVudDc3OTg0NTA2 1217238 2015-03-10T02:21:37Z 2015-03-10T02:21:37Z MEMBER

Hmm. ds['time.time'] appears to be broken in xray (it casts to a datetime64 array). I'll make a new issue for that.

However, it should work in pandas -- you can do df['time'].dt.time:

``` In [13]: t = pd.date_range('2000-01-01', periods=10000, freq='H')

In [14]: t.time Out[14]: array([datetime.time(0, 0), datetime.time(1, 0), datetime.time(2, 0), ..., datetime.time(13, 0), datetime.time(14, 0), datetime.time(15, 0)], dtype=object) ```

The simplest way to do timeofday, though, is probably just to calculate ds.coords['timeofday'] = ds['time.hour'] + 60 * ds['time.minute']. Then you can do ds.groupby('timeofday').

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