Skip to content

Commit f44aaad

Browse files
committed
REF: multi_take is now able to tackle all list-like (non-bool) cases
1 parent f4fba9e commit f44aaad

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

pandas/core/indexing.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -902,23 +902,12 @@ def _getitem_tuple(self, tup):
902902
return retval
903903

904904
def _multi_take_opportunity(self, tup):
905-
from pandas.core.generic import NDFrame
906-
907-
# ugly hack for GH #836
908-
if not isinstance(self.obj, NDFrame):
909-
return False
910-
911905
if not all(is_list_like_indexer(x) for x in tup):
912906
return False
913907

914908
# just too complicated
915-
for indexer, ax in zip(tup, self.obj._data.axes):
916-
if isinstance(ax, MultiIndex):
917-
return False
918-
elif com.is_bool_indexer(indexer):
919-
return False
920-
elif not ax.is_unique:
921-
return False
909+
if any(com.is_bool_indexer(x) for x in tup):
910+
return False
922911

923912
return True
924913

0 commit comments

Comments
 (0)