A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/pandas-docs/stable/reference/api/../api/pandas.MultiIndex.get_locs.html below:

pandas.MultiIndex.get_locs — pandas 2.3.1 documentation

pandas.MultiIndex.get_locs#
MultiIndex.get_locs(seq)[source]#

Get location for a sequence of labels.

Parameters:
seqlabel, slice, list, mask or a sequence of such

You should use one of the above for each level. If a level should not be used, set it to slice(None).

Returns:
numpy.ndarray

NumPy array of integers suitable for passing to iloc.

See also

MultiIndex.get_loc

Get location for a label or a tuple of labels.

MultiIndex.slice_locs

Get slice location given start label(s) and end label(s).

Examples

>>> mi = pd.MultiIndex.from_arrays([list('abb'), list('def')])
>>> mi.get_locs('b')  
array([1, 2], dtype=int64)
>>> mi.get_locs([slice(None), ['e', 'f']])  
array([1, 2], dtype=int64)
>>> mi.get_locs([[True, False, True], slice('e', 'f')])  
array([2], dtype=int64)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4