第三期:文末留言送书
Window
Rolling 对象在处理时间序列的数据时,应用广泛,在Python中Pandas包实现了对这类数据的处理。
Rolling 对象通过调用 pandas.DataFrame.rolling(), pandas.Series.rolling() 等生成。Expanding 对象通过调用 pandas.DataFrame.expanding(),pandas.Series.expanding()等生成。EWM( Exponentially-weighted moving) 对象通过调用 pandas.DataFrame.ewm(),pandas.Series.ewm()生成。
Rolling
原型为:
DataFrame.rolling(self, window, min_periods=None, center=False, win_type=None, on=None, axis=0, closed=None)
参数意义如下:
window : 取值为 int, 或时间相关 offset类型
移动窗口的宽度,是指用于统计计算的观察值的个数。 取值为int 时,每一个窗口宽度是固定的。

本文介绍了Python中的Pandas库如何使用Rolling对象进行时间序列数据处理,包括Rolling对象的生成方法和一个观察其在不同索引类型下closed参数影响的例子。
最低0.47元/天 解锁文章

1万+

被折叠的 条评论
为什么被折叠?



