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 431412346,MDU6SXNzdWU0MzE0MTIzNDY=,2882,Indexing with an empty sequence results in an exception,2745737,closed,0,,,0,2019-04-10T09:58:24Z,2019-04-12T00:25:44Z,2019-04-12T00:25:44Z,CONTRIBUTOR,,,,"#### 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 ```python # Your code here da = DataArray(np.arange(12).reshape((3, 4)), dims=['x', 'y']) da[{'x': [0]}] # Okay da[{'x': []}] # error ``` #### 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()``
# Paste the output here xr.show_versions() here commit: 2c10d1443bea09e5ef53e5a7e35195a195e193a7 python: 3.7.3 (default, Mar 27 2019, 09:23:15) [Clang 10.0.1 (clang-1001.0.46.3)] python-bits: 64 OS: Darwin OS-release: 18.5.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: en_GB.UTF-8 LANG: en_GB.UTF-8 LOCALE: en_GB.UTF-8 libhdf5: None libnetcdf: None 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
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2882/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue