pandas 1.4.2

NotesParametersReturns
std(self, ddof: 'int' = 1, *args, engine: 'str | None' = None, engine_kwargs: 'dict[str, bool] | None' = None, **kwargs)

Notes

The default ddof of 1 used in Series.std is different than the default ddof of 0 in numpy.std .

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

The implementation is susceptible to floating point imprecision as shown in the example below.

Parameters

ddof : int, default 1

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

*args :

For NumPy compatibility and will not have an effect on the result.

engine : str, default None
engine_kwargs : dict, default None
  • For 'cython' engine, there are no accepted engine_kwargs

  • For 'numba' engine, the engine can accept nopython , nogil and parallel dictionary keys. The values must either be True or False . The default engine_kwargs for the 'numba' engine is {'nopython': True, 'nogil': False, 'parallel': False}

    versionadded
**kwargs :

For NumPy compatibility and will not have an effect on the result.

Returns

Series or DataFrame

Return type is the same as the original object with np.float64 dtype.

Calculate the rolling standard deviation.

See Also

numpy.std

Equivalent method for NumPy array.

pandas.DataFrame.rolling

Calling rolling with DataFrames.

pandas.DataFrame.std

Aggregating std for DataFrame.

pandas.Series.rolling

Calling rolling with Series data.

pandas.Series.std

Aggregating std for Series.

Examples

This example is valid syntax, but we were not able to check execution
>>> s = pd.Series([5, 5, 6, 7, 5, 5, 5])
... s.rolling(3).std() 0 NaN 1 NaN 2 5.773503e-01 3 1.000000e+00 4 1.000000e+00 5 1.154701e+00 6 2.580957e-08 dtype: float64
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/window/rolling.py#2079
type: <class 'function'>
Commit: