pandas.Index.asof_locs

pandas 3.1.1 · Index objects · method

For each query, find the position of the last eligible value at or before it.

Call syntax

Index.asof_locs(where, mask)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
where Required
Positional or keyword
Index

Select data using a criterion or specify the label at which to look up a value.

mask Required
Positional or keyword
np.ndarray[bool]

Provide boolean positions where replacements should be applied.

Returns

np.ndarray[np.intp]