pandas.Index.get_loc
pandas 3.1.1 · Index objects · method
Look up the position or positions for a supplied index key.
Call syntax
Index.get_loc(key)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
key |
Required Positional or keyword |
label Provide the lookup key, or a transformation callable for a sorting method. |
Returns
int if unique index, slice if monotonic index, else mask