-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
DocsError ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesMultiIndex
Milestone
Description
I think this should raise as this is not clear how this should work (e.g. should you get all the other levels set to nan
?)
or see my comment below, maybe just document?
In [11]: s = pd.Series(np.arange(9),index=pd.MultiIndex.from_product([['A','B','C'],['foo','bar','baz']],names=['one','two'])).sortlevel()
In [12]: s
Out[12]:
one two
A bar 1
baz 2
foo 0
B bar 4
baz 5
foo 3
C bar 7
baz 8
foo 6
dtype: int64
In [13]: s.reindex(['A','B','D'],level=0)
Out[13]:
one two
A bar 1
baz 2
foo 0
B bar 4
baz 5
foo 3
dtype: int64
Witold1
Metadata
Metadata
Assignees
Labels
DocsError ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesMultiIndex