pandas.Series.asof

pandas 3.1.1 · Series and accessors · method

Look up the last usable observation at or before the requested label.

Call syntax

Series.asof(where, subset=None)

Run the example

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

Parameters

ParameterRequirementAccepted values and behavior
where Required
Positional or keyword
date or array-like of dates

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

subset Optional
Positional or keyword
Default None
str or array-like of str

Restrict the operation to these labels instead of considering the whole object.

Returns

scalar, Series, or DataFrame