File tree 1 file changed +28
-2
lines changed
1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -902,6 +902,20 @@ def _getitem_tuple(self, tup):
902
902
return retval
903
903
904
904
def _multi_take_opportunity (self , tup ):
905
+ """
906
+ Check whether there is the possibility to use ``_multi_take``.
907
+ Currently the limit is that all axes being indexed must be indexed with
908
+ list-likes.
909
+
910
+ Parameters
911
+ ----------
912
+ tup : tuple
913
+ Tuple of indexers, one per axis
914
+
915
+ Returns
916
+ -------
917
+ boolean: Whether the current indexing can be passed through _multi_take
918
+ """
905
919
if not all (is_list_like_indexer (x ) for x in tup ):
906
920
return False
907
921
@@ -912,9 +926,21 @@ def _multi_take_opportunity(self, tup):
912
926
return True
913
927
914
928
def _multi_take (self , tup ):
915
- """ create the reindex map for our objects, raise the _exception if we
916
- can't create the indexer
917
929
"""
930
+ Create the indexers for the passed tuple of keys, and execute the take
931
+ operation. This allows the take operation to be executed all at once -
932
+ rather than once for each dimension - improving efficiency.
933
+
934
+ Parameters
935
+ ----------
936
+ tup : tuple
937
+ Tuple of indexers, one per axis
938
+
939
+ Returns
940
+ -------
941
+ values: same type as the object being indexed
942
+ """
943
+ # GH 836
918
944
o = self .obj
919
945
d = {axis : self ._get_listlike_indexer (key , axis )
920
946
for (key , axis ) in zip (tup , o ._AXIS_ORDERS )}
You can’t perform that action at this time.
0 commit comments