home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 441088452

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
441088452 MDU6SXNzdWU0NDEwODg0NTI= 2944 `groupby` does not correctly handle non-dimensional coordinate 6815844 closed 0     3 2019-05-07T07:47:17Z 2021-05-21T23:12:21Z 2021-05-21T23:12:21Z MEMBER      

Code Sample, a copy-pastable example if possible

```python

import numpy as np import xarray as xr

da = xr.DataArray(np.arange(12).reshape(3, 4), dims=['x', 'y'], ... coords={'x': [0, 1, 1], 'x2': ('x', ['a', 'b', 'c'])}) grouped = da.groupby('x').mean('x') grouped <xarray.DataArray (x: 2, y: 4)> array([[0., 1., 2., 3.], [6., 7., 8., 9.]]) Coordinates: * x (x) int64 0 1 x2 (x) <U1 'a' 'b' 'c' # <-- this has length 3! Dimensions without coordinates: y ```

Problem description

groupby operation ignores the non-dimensional coordinate.

Expected Output

python <xarray.DataArray (x: 2, y: 4)> array([[0., 1., 2., 3.], [6., 7., 8., 9.]]) Coordinates: * x (x) int64 0 1 Dimensions without coordinates: y Compute mean of the coordinate. If not possible, drop it.

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

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