Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

pandas.core.window.rolling.Window.std#

Window.std(ddof=1,numeric_only=False,**kwargs)[source]#

Calculate the rolling weighted window standard deviation.

Parameters:
numeric_onlybool, default False

Include only float, int, boolean columns.

Added in version 1.5.0.

**kwargs

Keyword arguments to configure theSciPy weighted window type.

Returns:
Series or DataFrame

Return type is the same as the original object withnp.float64 dtype.

See also

pandas.Series.rolling

Calling rolling with Series data.

pandas.DataFrame.rolling

Calling rolling with DataFrames.

pandas.Series.std

Aggregating std for Series.

pandas.DataFrame.std

Aggregating std for DataFrame.

Examples

>>>ser=pd.Series([0,1,5,2,8])

To get an instance ofWindow we needto pass the parameterwin_type.

>>>type(ser.rolling(2,win_type='gaussian'))<class 'pandas.core.window.rolling.Window'>

In order to use theSciPy Gaussian window we need to provide the parametersM andstd. The parameterM corresponds to 2 in our example.We pass the second parameterstd as a parameter of the following method:

>>>ser.rolling(2,win_type='gaussian').std(std=3)0         NaN1    0.7071072    2.8284273    2.1213204    4.242641dtype: float64

[8]ページ先頭

©2009-2025 Movatter.jp