pandas.api.typing.Expanding.sem#
- Expanding.sem(ddof=1, numeric_only=False)[source]#
Calculate the expanding standard error of mean.
The standard error is computed as
std / sqrt(N)over all data points seen so far, whereNis the number of observations.- Parameters:
- ddofint, default 1
Delta Degrees of Freedom. The divisor used in calculations is
N - ddof, whereNrepresents the number of elements.- numeric_onlybool, default False
Include only float, int, boolean columns.
- Returns:
- Series or DataFrame
Return type is the same as the original object with
np.float64dtype.
See also
Series.expandingCalling expanding with Series data.
DataFrame.expandingCalling expanding with DataFrames.
Series.semAggregating sem for Series.
DataFrame.semAggregating sem for DataFrame.
Notes
A minimum of one period is required for the calculation.
Examples
>>> s = pd.Series([0, 1, 2, 3])
>>> s.expanding().sem() 0 NaN 1 0.500000 2 0.577350 3 0.645497 dtype: float64