@@ -2879,37 +2879,37 @@ def convert_indexer(start, stop, step, indexer=indexer, codes=level_codes):
2879
2879
2880
2880
def get_locs (self , seq ):
2881
2881
"""
2882
- Get location for a given label/slice/list/mask or a sequence of such as
2883
- an array of integers.
2882
+ Get location for a sequence of labels.
2884
2883
2885
2884
Parameters
2886
2885
----------
2887
- seq : label/ slice/ list/ mask or a sequence of such
2886
+ seq : label, slice, list, mask or a sequence of such
2888
2887
You should use one of the above for each level.
2889
2888
If a level should not be used, set it to ``slice(None)``.
2890
2889
2891
2890
Returns
2892
2891
-------
2893
- locs : array of integers suitable for passing to iloc
2892
+ numpy.ndarray
2893
+ NumPy array of integers suitable for passing to iloc.
2894
+
2895
+ See Also
2896
+ --------
2897
+ MultiIndex.get_loc : Get location for a label or a tuple of labels.
2898
+ MultiIndex.slice_locs : Get slice location given start label(s) and
2899
+ end label(s).
2894
2900
2895
2901
Examples
2896
2902
--------
2897
2903
>>> mi = pd.MultiIndex.from_arrays([list('abb'), list('def')])
2898
2904
2899
- >>> mi.get_locs('b')
2905
+ >>> mi.get_locs('b') # doctest: +SKIP
2900
2906
array([1, 2], dtype=int64)
2901
2907
2902
- >>> mi.get_locs([slice(None), ['e', 'f']])
2908
+ >>> mi.get_locs([slice(None), ['e', 'f']]) # doctest: +SKIP
2903
2909
array([1, 2], dtype=int64)
2904
2910
2905
- >>> mi.get_locs([[True, False, True], slice('e', 'f')])
2911
+ >>> mi.get_locs([[True, False, True], slice('e', 'f')]) # doctest: +SKIP
2906
2912
array([2], dtype=int64)
2907
-
2908
- See Also
2909
- --------
2910
- MultiIndex.get_loc : Get location for a label or a tuple of labels.
2911
- MultiIndex.slice_locs : Get slice location given start label(s) and
2912
- end label(s).
2913
2913
"""
2914
2914
from .numeric import Int64Index
2915
2915
0 commit comments