issues: 372006204
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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 372006204 | MDU6SXNzdWUzNzIwMDYyMDQ= | 2496 | Incorrect conversion from sliced pd.MultiIndex | 1882397 | closed | 0 | 2 | 2018-10-19T15:25:38Z | 2019-02-19T09:42:52Z | 2019-02-19T09:42:51Z | NONE | If we convert a pandas dataframe with a multiindex, slice it to remove some entries from the index, a converted DataArray still contains the removed items in the coordinates (although the values are NaN). ```python We create an example dataframeidx = pd.MultiIndex.from_product([list('abc'), list('xyz')])
df = pd.DataFrame(data={'col': np.random.randn(len(idx))}, index=idx)
df.columns.name = 'cols'
df.index.names = ['idx1', 'idx2']
df2 = df.loc[['a', 'b']]
df2 does not contain
|
{
"url": "https://api.github.com/repos/pydata/xarray/issues/2496/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
completed | 13221727 | issue |