pandas.DataFrame.expanding
pandas 3.1.1 · DataFrame · method
Build a window that grows from the start through each observation.
Call syntax
DataFrame.expanding(min_periods=1, method='single')Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
min_periods |
Optional Positional or keyword Default 1 |
int Require this many valid observations in a window before pandas reports a value. |
method |
Optional Positional or keyword Default 'single' |
str {'single', 'table'} Choose the algorithm used to calculate, align, or fill the result. |
Returns
pandas.api.typing.Expanding