pd.rolling_mean becoming deprecated - alternatives for ndarrays

前端 未结 5 700
自闭症患者
自闭症患者 2020-12-16 14:09

EDIT: This question was asked in 2016 and similar questions have been posted on SO years later after the functionality was finally removed, e.g. module 'pandas' has

5条回答
  •  我在风中等你
    2020-12-16 14:17

    Looks like the new way is via methods on the DataFrame.rolling class (I guess you're meant to think of it sort of like a groupby): http://pandas.pydata.org/pandas-docs/version/0.18.0/whatsnew.html

    e.g.

    x.rolling(window=2).mean()
    

提交回复
热议问题