issues: 623131373
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
623131373 | MDU6SXNzdWU2MjMxMzEzNzM= | 4087 | Bug in conversion frompd.series in 0.15.1 | 1277781 | closed | 0 | 3 | 2020-05-22T11:04:11Z | 2020-05-22T11:59:40Z | 2020-05-22T11:29:46Z | CONTRIBUTOR | Bug in conversion frompd.series MCVE Code Sample```python import pandas as pd import xarray as xr data3 = pd.DataFrame([(1, 2, 1), (2, 2, 1)],columns=['x', 'B', 'A']) data3 = data3.set_index(['x']) data3.rename_axis('tag', axis=1, inplace=True) data3 = data3.stack() print(data3) print(xr.DataArray.from_series(data3).sel(tag='B')) ``` Expected Output[2,2] Problem DescriptionThe same code gives the expected output in xarray 0.14.1 Also works correctly if "tag" dimension is properly sorted during DataFrame cretion. VersionsOutput of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.6.7 | packaged by conda-forge | (default, Jul 2 2019, 02:18:42) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.1.12-124.38.1.el7uek.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_US.utf8 LANG: en_US.utf8 LOCALE: en_US.UTF-8 libhdf5: 1.10.4 libnetcdf: 4.6.3 xarray: 0.15.1 pandas: 0.25.0 numpy: 1.17.0 scipy: 1.3.0 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.7.1 Nio: None zarr: None cftime: 1.1.3 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.16.0 distributed: None matplotlib: 3.1.1 cartopy: None seaborn: 0.9.0 numbagg: None setuptools: 46.3.1 pip: 19.2.1 conda: 4.8.3 pytest: 5.3.0 IPython: 7.7.0 sphinx: 2.1.2 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4087/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |