issues: 546727720
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
546727720 | MDU6SXNzdWU1NDY3Mjc3MjA= | 3669 | Fail to sel() when index comes from categorical pandas Series | 31126826 | closed | 0 | 3 | 2020-01-08T09:00:20Z | 2020-01-25T22:38:20Z | 2020-01-25T22:38:20Z | CONTRIBUTOR | Dear xarray team, Thank you very much for your work on this useful package. Here is a bug I just found in my code. MCVE Code SampleCreating a Dataset from pandas when the coordinate is a categorical series: ```python import pandas as pd ind = pd.Series(['foo', 'bar'], dtype='category') df = pd.DataFrame({'ind': ind, 'values': [1, 2]}) df = df.set_index('ind') ds = df.to_xarray() print(ds.sel(ind='foo')) ``` Expected OutputWhen Problem DescriptionWhen Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3669/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |