pandas.api.typing.Rolling.sem#
- Rolling.sem(ddof=1, numeric_only=False)[source]#
Calculate the rolling standard error of mean.
This is computed as the rolling standard deviation divided by the square root of the rolling count. A minimum of one period is required.
- 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.rollingCalling rolling with Series data.
DataFrame.rollingCalling rolling 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.rolling(2, min_periods=1).sem() 0 NaN 1 0.5 2 0.5 3 0.5 dtype: float64