pandas.DataFrame.asof
pandas 3.1.1 · DataFrame · method
Look up the last usable observation at or before the requested label.
Call syntax
DataFrame.asof(where, subset=None)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted 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