BUG/API: bug in multi-index slicing with missing indexers #7866

Closed
jreback opened this Issue Jul 29, 2014 · 0 comments

Comments

Projects
None yet
1 participant
Contributor

jreback commented Jul 29, 2014

I think the following could work and not raise KeyError because of a missing indexer. This would follow the API of loc which will be effectively a reindex as long as you have at least 1 found value.

s = pd.Series(np.arange(9),index=pd.MultiIndex.from_product([['A','B','C'],['foo','bar','baz']],names=['one','two'])).sortlevel()

s.loc[['A','D']]

idx = pd.IndexSlice
s.loc[idx[:,['foo','bah']]]

jreback added this to the 0.15.0 milestone Jul 29, 2014

jreback closed this in #7867 Jul 30, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment