issues: 1047599975
This data as json
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1047599975 | I_kwDOAMm_X84-cRtn | 5953 | Selecting with MultiIndex raises a TypeError | 34740232 | closed | 0 | 4160723 | 1 | 2021-11-08T15:39:10Z | 2022-03-17T17:11:43Z | 2022-03-17T17:11:43Z | NONE | What happened: After updating xarray to v0.20.1, some of my multi-index-based selection code raises a What you expected to happen: Selection should work in the case I am considering. Minimal Complete Verifiable Example: ```python import xarray as xr import pandas as pd da = xr.DataArray(data=[0, 1, 2, 3], dims=("x",)).reindex( {"x": pd.MultiIndex.from_product((["foo", "bar"], [0, 1]), names=("str", "int"))} ) print(da.sel(x=("foo", 1))) ``` Expected output (what I get with xarray 0.19.0):
Actual output (with xarray 0.20.1):
Anything else we need to know?: Nothing I'm aware of Environment: Output of <tt>xr.show_versions()</tt> (with xarray 0.19.0)INSTALLED VERSIONS ------------------ commit: None python: 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 05:57:50) [Clang 11.1.0 ] python-bits: 64 OS: Darwin OS-release: 20.6.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: (None, 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1 xarray: 0.19.0 pandas: 1.3.4 numpy: 1.21.4 scipy: 1.7.1 netCDF4: 1.5.8 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.5.1.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2021.11.0 distributed: 2021.11.0 matplotlib: 3.4.3 cartopy: None seaborn: 0.11.2 numbagg: None pint: 0.18 setuptools: 58.5.3 pip: 21.3.1 conda: None pytest: 6.2.5 IPython: 7.29.0 sphinx: 4.2.0Output of <tt>xr.show_versions()</tt> (with xarray 0.20.1)INSTALLED VERSIONS ------------------ commit: None python: 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 05:57:50) [Clang 11.1.0 ] python-bits: 64 OS: Darwin OS-release: 20.6.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: (None, 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1 xarray: 0.20.1 pandas: 1.3.4 numpy: 1.21.4 scipy: 1.7.1 netCDF4: 1.5.8 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.5.1.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2021.11.0 distributed: 2021.11.0 matplotlib: 3.4.3 cartopy: None seaborn: 0.11.2 numbagg: None fsspec: 2021.11.0 cupy: None pint: 0.18 sparse: None setuptools: 58.5.3 pip: 21.3.1 conda: None pytest: 6.2.5 IPython: 7.29.0 sphinx: 4.2.0 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5953/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |