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
Using an xr.DataArray as the dim parameter to xr.concat does not name the new dimension with the name of the given DataArray (a generic dim_0 is used instead), though the coordinate information is captured correctly. This unexpected behavior does not happen when using a pd.Index as the dim parameter.
The text was updated successfully, but these errors were encountered:
raj-magesh
changed the title
Inconsistent behavior when using xr.concat() with pd.Index vs xd.DataArray as dim parameter for a new dimension
Inconsistent behavior when using xr.concat() with pd.Index vs xr.DataArray as dim parameter for a new dimension
Nov 23, 2021
summary
Using an
xr.DataArray
as thedim
parameter toxr.concat
does not name the new dimension with thename
of the given DataArray (a genericdim_0
is used instead), though the coordinate information is captured correctly. This unexpected behavior does not happen when using apd.Index
as thedim
parameter.minimal reproducible example
concatenating using
pd.Index
asdim
parameterOutput: as expected, the new dimension has the name
new_dim
and the specified coordinate informationconcatenating using
xr.DataArray
asdim
parameterOutput: inconsistent with the
pd.Index
method, the new dimension does NOT have the specified namenew_dim
, though it has the coordinate informationEnvironment:
Output of xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.9.5 | packaged by conda-forge | (default, Jun 19 2021, 00:32:32)
[GCC 9.3.0]
python-bits: 64
OS: Linux
OS-release: 3.10.0-1160.31.1.el7.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.0
libnetcdf: 4.7.4
xarray: 0.20.1
pandas: 1.3.1
numpy: 1.21.1
scipy: 1.7.0
netCDF4: 1.5.7
pydap: None
h5netcdf: None
h5py: 3.3.0
Nio: None
zarr: None
cftime: 1.5.0
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 2021.09.0
distributed: None
matplotlib: 3.4.2
cartopy: None
seaborn: 0.11.1
numbagg: None
fsspec: 2021.08.1
cupy: None
pint: None
sparse: None
setuptools: 49.6.0.post20210108
pip: 21.3.1
conda: None
pytest: None
IPython: 7.24.1
sphinx: None
The text was updated successfully, but these errors were encountered: