pandas.api.typing.Window.std

pandas 3.1.1 · Window operations · method

Calculate weighted standard deviation within each rolling window.

Call syntax

pd.api.typing.Window.std(ddof=1, numeric_only=False, **kwargs)

Inspect the call

Run this code to inspect the callable and its parameters. Its data, backend, or environment is needed to execute the operation itself.

Parameters

ParameterRequirementAccepted values and behavior
ddof Optional
Positional or keyword
Default 1
int

Set the degrees of freedom correction. The usual variance divisor is N minus ddof.

numeric_only Optional
Positional or keyword
Default False
bool

Restrict the calculation to columns pandas considers numeric where applicable.

**kwargs Optional
Additional keyword arguments

Returns

Series or DataFrame

Example for a local Python session

import pandas as pd
import scipy
values = pd.Series([2., 5., 7.], name="units")
window = values.rolling(2, win_type="boxcar")
print(window.std())