home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 331569116

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
331569116 MDU6SXNzdWUzMzE1NjkxMTY= 2226 duplicate coord names in DataArray constructor 14019925 closed 0     3 2018-06-12T12:37:57Z 2023-12-01T00:40:19Z 2023-12-01T00:40:19Z CONTRIBUTOR      

Code Sample

```python

import numpy as np import xarray as xr da = xr.DataArray(np.zeros((2,3)), coords=[('unknown', [1, 2]), ('unknown', [0, 90, 180])]) da <xarray.DataArray (unknown: 3)> array([[0., 0., 0.], [0., 0., 0.]]) Coordinates: * unknown (unknown) int64 0 90 180 da.dims ('unknown', 'unknown') da.coords Coordinates: * unknown (unknown) int64 0 90 180 da.sel(unknown=90) ValueError: conflicting sizes for dimension 'unknown': length 2 on <this-array> and length 3 on 'unknown'

```

Problem description

The DaraArray constructor creates an invalid DataArray given duplicate coordinate names.

Expected Output

The DaraArray constructor should raise an Exception given duplicate coordinates names.

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.5.final.0 python-bits: 64 OS: Linux OS-release: 3.16.0-5-amd64 machine: x86_64 processor: byteorder: little LC_ALL: None LANG: en_GB.UTF-8 LOCALE: en_GB.UTF-8 xarray: 0.10.4 pandas: 0.23.0 numpy: 1.14.3 scipy: 1.1.0 netCDF4: 1.3.1 h5netcdf: 0.5.1 h5py: 2.8.0 Nio: None zarr: None bottleneck: 1.2.1 cyordereddict: None dask: 0.17.5 distributed: 1.21.8 matplotlib: 2.2.2 cartopy: 0.16.0 seaborn: None setuptools: 39.1.0 pip: 10.0.1 conda: None pytest: 3.5.1 IPython: None sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2226/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

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