pandas.core.resample.Resampler.std#

final Resampler.std(ddof=1, numeric_only=False, *args, **kwargs)[源代码]#

计算组的标准差,排除缺失值。

Parameters:
ddofint, 默认值 1

自由度。

numeric_onlybool,默认 False

仅包含 float, intboolean 数据。

在 1.5.0 版本加入.

在 2.0.0 版本发生变更: numeric_only 现在默认为 False

Returns:
DataFrame 或 Series

组内值的标准差。

Examples

>>> ser = pd.Series([1, 3, 2, 4, 3, 8],
...                 index=pd.DatetimeIndex(['2023-01-01',
...                                         '2023-01-10',
...                                         '2023-01-15',
...                                         '2023-02-01',
...                                         '2023-02-10',
...                                         '2023-02-15']))
>>> ser.resample('MS').std()
2023-01-01    1.000000
2023-02-01    2.645751
Freq: MS, dtype: float64