Expanding#

Expanding window operations for cumulative calculations.

Example#

import pandasCore as pd

s = pd.Series([1, 2, 3, 4, 5])
s.expanding().mean()  # [1.0, 1.5, 2.0, 2.5, 3.0]
s.expanding().sum()   # [1, 3, 6, 10, 15]

Parameters#

Parameter

Type

Default

Description

min_periods

int

1

Minimum observations needed

center

bool

False

Set labels at center

axis

int

0

Axis to expand on

Methods#

Same aggregation methods as Rolling:

  • count(), sum(), mean(), median()

  • var(), std(), min(), max()

  • corr(), cov(), skew(), kurt()

  • apply(), agg(), quantile(), sem(), rank()