home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 412659630

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/2363#issuecomment-412659630 https://api.github.com/repos/pydata/xarray/issues/2363 412659630 MDEyOklzc3VlQ29tbWVudDQxMjY1OTYzMA== 1217238 2018-08-13T20:51:14Z 2018-08-13T20:51:14Z MEMBER

This does seem to be a little inconsistent currently.

My original reasoning for the default groupby behavior was that that this felt more consistent with the behavior for non-grouped reductions, which reduces across all dimensions.

But it's probably less useful, and results in a lot of redundant code. I can only think of a few times when I've actually wanted this behavior, rather than summing over only the grouped dimension. Especially when going from 1D -> ND, this is a likely source of errors.

So instead, we could change this to: ds.groupby('time.month').mean() # result dims : ('month', 'x') ds.groupby('time.month').mean(dim=None) # result dims : ('month',)

Or maybe we could add a special constant xarray.ALL_DIMS to indicate all dimensions? This is probably the most readable version: ds.groupby('time.month').mean(dim=xarray.ALL_DIMS) # result dims : ('month',)

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