issues: 927336712
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
927336712 | MDU6SXNzdWU5MjczMzY3MTI= | 5510 | Can't remove coordinates attribute from DataArrays | 40183561 | open | 0 | 11 | 2021-06-22T15:05:43Z | 2023-09-29T11:48:50Z | CONTRIBUTOR | What happened: Coordinates added to some variables unexpectedly. I noticed this after outputting to netCDF. What I have:
On What you expected to happen: Looking only at the coordinates attribute, I expected my ncdump to show:
I tried to remove this in the xarray dataset, but whatever I tried they always ended up back in there: ```
show coords on realization
try reset_coords - removes the coords
set realization with result of reset_coords
coords back in
try drop_vars - same thing happens
tried creating a new variable to see if the same thing happens - it does
This seems like incorrect behaviour, but perhaps it is expected? Minimal Complete Verifiable Example: ```python
ds.to_netcdf("file.nc") ```
Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.7.3 (default, Mar 27 2019, 16:54:48) [Clang 4.0.1 (tags/RELEASE_401/final)] python-bits: 64 OS: Darwin OS-release: 18.7.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_GB.UTF-8 LOCALE: ('en_GB', 'UTF-8') libhdf5: 1.10.5 libnetcdf: 4.6.3 xarray: 0.18.2 pandas: 1.1.3 numpy: 1.19.2 scipy: None netCDF4: 1.5.4 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.4.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2.30.0 distributed: 2.30.0 matplotlib: None cartopy: None seaborn: None numbagg: None pint: None setuptools: 54.1.1 pip: 21.0.1 conda: None pytest: 6.2.2 IPython: 7.21.0 sphinx: 1.8.1 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5510/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
reopened | 13221727 | issue |