pandas.core.window.expanding.Expanding.sem

Expanding.sem(ddof=1, *args, **kwargs)[source]

Compute expanding standard error of mean.

Parameters
ddofint, default 1

Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements.

*args, **kwargs

For NumPy compatibility. No additional arguments are used.

Returns
Series or DataFrame

Returned object type is determined by the caller of the expanding calculation.

See also

pandas.Series.expanding

Calling object with Series data.

pandas.DataFrame.expanding

Calling object with DataFrames.

pandas.Series.sem

Equivalent method for Series.

pandas.DataFrame.sem

Equivalent method for DataFrame.

Notes

A minimum of one period is required for the rolling calculation.

Examples

>>> s = pd.Series([0, 1, 2, 3])
>>> s.rolling(2, min_periods=1).sem()
0         NaN
1    0.707107
2    0.707107
3    0.707107
dtype: float64
>>> s.expanding().sem()
0         NaN
1    0.707107
2    0.707107
3    0.745356
dtype: float64