pandas.core.window.rolling.Rolling.mean
作者:互联网
Rolling.mean(*args, engine=None, engine_kwargs=None, **kwargs)
Calculate the rolling mean.计算滚动窗口的平均值
examples
The below examples will show rolling mean calculations with window sizes of two and three, respectively.
s = pd.Series([1, 2, 3, 4])
s.rolling(2).mean()
0 NaN
1 1.5
2 2.5
3 3.5
dtype: float64
s.rolling(3).mean()
0 NaN
1 NaN
2 2.0
3 3.0
dtype: float64
标签:core,dtype,NaN,rolling,window,examples,Rolling,mean 来源: https://www.cnblogs.com/juneyiiii/p/16494393.html