home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 46768521

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
46768521 MDU6SXNzdWU0Njc2ODUyMQ== 268 groupby reduction sometimes collapses variables into scalars 291576 closed 0     3 2014-10-24T18:25:45Z 2015-04-08T03:44:09Z 2015-04-08T03:44:09Z CONTRIBUTOR      

If groupby is done on a Dataset, and all of the values for a particular variable are identical, then the variable is collapsed into a scalar. The same does not occur if the same thing is done to a DataArray. At first, I thought this was useful, but it caused problems because I could no longer concat() datasets together that sometimes had a scalar variable and sometimes did not.

```

x1 = xray.DataArray(np.arange(0, 10, 0.2), name='x') a = xray.DataArray(np.zeros(x1.shape), {'dim_0': x1}, name='foo') a.to_dataset().groupby(np.round(x1)).reduce(np.min) <xray.Dataset> Dimensions: (x: 11) Coordinates: * x (x) float64 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 Variables: foo float64 0.0 a.groupby(np.round(x1)).reduce(np.min) <xray.DataArray 'foo' (x: 11)> array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]) Coordinates: * x (x) float64 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/268/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

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