home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 316377854

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/1483#issuecomment-316377854 https://api.github.com/repos/pydata/xarray/issues/1483 316377854 MDEyOklzc3VlQ29tbWVudDMxNjM3Nzg1NA== 4992424 2017-07-19T12:59:04Z 2017-07-19T12:59:04Z NONE

Instead of computing the mean over your non-stacked dimension by

python dsg = dst.groupby('allpoints').mean()

why not just instead call

python dsg = dst.mean('time', keep_attrs=True)

so that you just collapse the time dimension and preserve the attributes on your data? Then you can unstack() and everything should still be there. The idiom of stacking/applying/unstacking is really useful to fit your data to the interface of a numpy or scipy function that will do all the heavy lifting with a vectorized routine for you - isn't using groupby in this way really slow?

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