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
Groupby reduction operations on Dataset objects no longer seem to work in xarray v0.13. In the example, above I create an xarray dataset with one dataarray called "a". The same groupby operations fails on this Dataset, but succeeds when called directly on "a". Is this a bug or an intended change?
In addition the error message is confusing since z is one of the Dataset dimensions.
@nbren12 I had a quick look at this on my commute this morning.
Somehow squeeze=True when it is False in the groupby constructor. Not sure why.
For squeeze=True, the Dataset behaviour is correct since you're attempting to reduce along the grouped dimension which has been squeezed out. DataArray is incorrectly reducing all dimensions in each group (This was deprecated in 0.13)
I have partial fix in #3338 with a better error message but it needs tests and docs; and also a fix for squeeze being True by default. If you have time, can you finish that up?
MCVE Code Sample
Problem Description
Groupby reduction operations on
Dataset
objects no longer seem to work in xarray v0.13. In the example, above I create an xarray dataset with one dataarray called "a". The same groupby operations fails on thisDataset
, but succeeds when called directly on "a". Is this a bug or an intended change?In addition the error message is confusing since
z
is one of the Dataset dimensions.Output of
xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 14:38:56)
[Clang 4.0.1 (tags/RELEASE_401/final)]
python-bits: 64
OS: Darwin
OS-release: 18.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
libhdf5: None
libnetcdf: None
xarray: 0.13.0
pandas: 0.25.1
numpy: 1.17.2
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
setuptools: 41.2.0
pip: 19.2.3
conda: None
pytest: None
IPython: None
sphinx: None
The text was updated successfully, but these errors were encountered: