home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1068305154

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/pull/6353#issuecomment-1068305154 https://api.github.com/repos/pydata/xarray/issues/6353 1068305154 IC_kwDOAMm_X84_rQsC 10194086 2022-03-15T18:13:39Z 2022-03-15T18:13:39Z MEMBER

Nice! I did not know about coarsen(...).construct(...) - interesting. I usually use set_index for that - could be interesting to test which approach is faster.

```python def _to_seasonal(ds):

year = ds.time.dt.year.data
season = ds.time.dt.season.data

# assign new coords
ds = ds.assign_coords(year=("time", year), season=("time", season))

# reshape the array to (..., "season", "year")
return ds.set_index(time=("year", "season")).unstack("time")

```

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