Closed
Description
xref #7886
It would be nice to be able to write:
s[s.index.isin(['a', 'b', 'c'], level='foo')]
instead of
s[s.index.get_level_values('foo').isin(['a', 'b', 'c'])]
The former variant is not only shorter but is also potentially more performant: one only has to look up levels in given container and then operate on labels only avoiding instantiation of sub-index completely.
Default value should be None
, plain Index
objects should only accept None
, 0
, and, Index.name
for the sake of consistency (the last one is especially arguable).