home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 1115166039

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
1115166039 I_kwDOAMm_X85CeBVX 6196 Wrong list of coordinate when a singleton coordinate exists 32069530 open 0     5 2022-01-26T15:41:37Z 2023-03-01T19:55:13Z   NONE      

What happened?

Here is some simple code: a = xr.DataArray(np.arange(5), dims='x', coords={'x':np.arange(5)}) a = a.assign_coords({'y':1}) Now calling a['x'] or a['x'].coords shows y as a coordinate of x, which is unexpected for me

What did you expect to happen?

I expect that a singleton coordinate of a dataset not to be a coordinate of other coordinates present in the dataset

Minimal Complete Verifiable Example

import xarray as xr import numpy as np a = xr.DataArray(np.arange(5), dims='x', coords={'x':np.arange(5)}) a = a.assign_coords({'y':1}) print(a['x'].coords) returns Coordinates: * x (x) int64 0 1 2 3 4 y int64 1

Relevant log output

No response

Anything else we need to know?

No response

Environment

INSTALLED VERSIONS

commit: None python: 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:57:06) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 3.12.53-60.30-default machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1

xarray: 0.19.0 pandas: 1.3.5 numpy: 1.20.3 scipy: 1.6.3 netCDF4: 1.5.8 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.5.1.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2021.10.0 distributed: 2021.10.0 matplotlib: 3.2.2 cartopy: None seaborn: None numbagg: None pint: None setuptools: 60.5.0 pip: 21.3.1 conda: None pytest: None IPython: 7.31.0 sphinx: None

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6196/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

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