@@ -2015,8 +2015,8 @@ def get_loc(self, key, method=None):
2015
2015
See also
2016
2016
--------
2017
2017
Index.get_loc : get_loc method for (single-level) index.
2018
- get_locs : Get location for a label/slice/list/mask or a sequence of
2019
- such.
2018
+ MultiIndex. get_locs : Get location for a label/slice/list/mask or a
2019
+ sequence of such.
2020
2020
"""
2021
2021
if method is not None :
2022
2022
raise NotImplementedError ('only the default get_loc method is '
@@ -2340,23 +2340,24 @@ def convert_indexer(start, stop, step, indexer=indexer, labels=labels):
2340
2340
def get_locs (self , seq ):
2341
2341
"""
2342
2342
Get location for a given label/slice/list/mask or a sequence of such as
2343
- a integer, slice or boolean mask .
2343
+ an array of integers .
2344
2344
2345
2345
Parameters
2346
2346
----------
2347
- seq : label/slice/list/mask or a sequence of such.
2347
+ seq : label/slice/list/mask or a sequence of such (one for each used
2348
+ level. If a level should not be used, set it to
2349
+ ``slice(None)``).
2348
2350
2349
2351
Returns
2350
2352
-------
2351
- locs : integer, slice or boolean mask suitable
2352
- for passing to iloc
2353
+ locs : array of integers suitable for passing to iloc
2353
2354
2354
2355
Examples
2355
2356
---------
2356
2357
>>> mi = pd.MultiIndex.from_arrays([list('abb'), list('def')])
2357
2358
2358
2359
>>> mi.get_locs('b')
2359
- slice( 1, 3, None )
2360
+ array([ 1, 2], dtype=int64 )
2360
2361
2361
2362
>>> mi.get_locs([slice(None), ['e', 'f']])
2362
2363
array([1, 2], dtype=int64)
@@ -2366,7 +2367,7 @@ def get_locs(self, seq):
2366
2367
2367
2368
See also
2368
2369
--------
2369
- get_loc : Get location for a label or a tuple of labels.
2370
+ MultiIndex. get_loc : Get location for a label or a tuple of labels.
2370
2371
"""
2371
2372
2372
2373
# must be lexsorted to at least as many levels
0 commit comments