You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a DataArray is reindex() with a list, the Series created from DataArray.to_series() has an index with no name in the reindexed dimension. It was working for 2+ dimension array in 0.16.2 (i.e. the Series has MultiIndex instead of Index), but 0.17.0 doesn't work. For 1 dimension array, both 0.16.2 and 0.17.0 are not working as expected.
What you expected to happen:
I expect the Index.names of Series created from DataArray.to_series() contains the name of the dimensions of the DataArray, no matter reindex() was called on the DataArray before or not.
The example tests by @yhlam currently pass in xarray: 2023.2.1.dev7+g21d86450. Using git bisect, it seems like this issue was fixed as part of the explicit indexes PR #5692. I guess that means this issue can be closed?
What happened:
If a
DataArray
isreindex()
with alist
, theSeries
created fromDataArray.to_series()
has an index with no name in the reindexed dimension. It was working for 2+ dimension array in 0.16.2 (i.e. theSeries
hasMultiIndex
instead ofIndex
), but 0.17.0 doesn't work. For 1 dimension array, both 0.16.2 and 0.17.0 are not working as expected.What you expected to happen:
I expect the
Index.names
ofSeries
created fromDataArray.to_series()
contains the name of the dimensions of theDataArray
, no matterreindex()
was called on theDataArray
before or not.Minimal Complete Verifiable Example:
Version 0.16.2:
It works as expected for
MultiIndex
. However, the index name is missing after reindex for 1 dimension array.Version 0.17.0:
Index name is missing after reindex on both single level
Index
andMultiIndex
.Environment:
Output of xr.show_versions() for 0.16.2
commit: None
python: 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 158 Stepping 13, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: English_United States.1252
libhdf5: None
libnetcdf: None
xarray: 0.16.2
pandas: 1.2.3
numpy: 1.20.1
scipy: None
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
pint: None
setuptools: 53.0.0
pip: 21.0.1
conda: None
pytest: 6.2.2
IPython: 7.21.0
sphinx: None
Output of xr.show_versions() for 0.17.0
commit: None
python: 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 158 Stepping 13, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: English_United States.1252
libhdf5: None
libnetcdf: None
xarray: 0.17.0
pandas: 1.2.3
numpy: 1.20.1
scipy: None
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
pint: None
setuptools: 53.0.0
pip: 21.0.1
conda: None
pytest: 6.2.2
IPython: 7.21.0
sphinx: None
The text was updated successfully, but these errors were encountered: