home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 247697176

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
247697176 MDU6SXNzdWUyNDc2OTcxNzY= 1499 Reusing coordinate doesn't show in the dimensions 2941720 closed 0     10 2017-08-03T12:55:35Z 2023-12-02T02:50:25Z 2023-12-02T02:50:25Z CONTRIBUTOR      

For a DataArray, when reusing a coordinate for multiple dimensions (is this expected usage?), it only shows once in the repr:

```python

x = xr.IndexVariable(data=range(5), dims='x') da = xr.DataArray(data=np.random.randn(5, 5), coords={'x': x}, dims=('x', 'x')) da <xarray.DataArray (x: 5)> array([[ 0.704139, 0.135638, -0.84717 , -0.580167, 0.95755 ], [ 0.966196, -0.126107, 0.547461, 1.075547, -0.477495], [-0.507956, -0.671571, 1.271085, 0.007741, -0.37878 ], [-0.969021, -0.440854, 0.062914, -0.3337 , -0.775898], [ 0.86893 , 0.227861, 1.831021, 0.702769, 0.868767]]) Coordinates: * x (x) int64 0 1 2 3 4 ```

I think it should be

python <xarray.DataArray (x: 5, x: 5)> array([[ ... ]]) Coordinates: * x (x) int64 0 1 2 3 4

Otherwise, everything appears to work exactly as I would expect.

This isn't an issue for Datasets:

```python

xr.Dataset({'da': da}) <xarray.Dataset> Dimensions: (x: 5) Coordinates: * x (x) int64 0 1 2 3 4 Data variables: da (x, x) float64 0.08976 0.1049 -1.291 -0.4605 -0.005165 -0.3259 ... ```

Thanks!

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1499/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
  • 9 rows from issue in issue_comments
Powered by Datasette · Queries took 1.006ms · About: xarray-datasette