pandas.api.typing.DataFrameGroupBy.expanding

pandas 3.1.1 · GroupBy · method

Build a window that grows from the start through each observation.

Call syntax

pd.api.typing.DataFrameGroupBy.expanding(min_periods=1, method='single')

Run the example

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

Parameters

ParameterRequirementAccepted 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.ExpandingGroupBy