We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A "Minimal, Complete and Verifiable Example" will make it much easier for maintainers to help you: http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports
# Your code here da = DataArray(np.arange(12).reshape((3, 4)), dims=['x', 'y']) da[{'x': [0]}] # Okay da[{'x': []}] # error
Indexing with an empty list results in an exception.
It should return a dataarray with an axis of length zero.
xr.show_versions()
xarray: 0.12.1+4.g2c10d144.dirty pandas: 0.24.2 numpy: 1.16.2 scipy: 1.2.1 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: 1.2.1 dask: None distributed: None matplotlib: 3.0.3 cartopy: None seaborn: None setuptools: 41.0.0 pip: 19.0.3 conda: None pytest: 4.3.1 IPython: 7.4.0 sphinx: None
The text was updated successfully, but these errors were encountered:
Indexing with an empty array
2e1c06b
Closes pydata#2882
Indexing with an empty array (#2883)
3354059
* Indexing with an empty array Closes #2882 * Adds 2882 resolution to whats-new.rst * Create empty indexing array directly * assert xxx -> asset_identical
Successfully merging a pull request may close this issue.
Code Sample, a copy-pastable example if possible
A "Minimal, Complete and Verifiable Example" will make it much easier for maintainers to help you:
http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports
Problem description
Indexing with an empty list results in an exception.
Expected Output
It should return a dataarray with an axis of length zero.
Output of
xr.show_versions()
xarray: 0.12.1+4.g2c10d144.dirty
pandas: 0.24.2
numpy: 1.16.2
scipy: 1.2.1
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: 1.2.1
dask: None
distributed: None
matplotlib: 3.0.3
cartopy: None
seaborn: None
setuptools: 41.0.0
pip: 19.0.3
conda: None
pytest: 4.3.1
IPython: 7.4.0
sphinx: None
The text was updated successfully, but these errors were encountered: