ipython-books / cookbook-code

[DEPRECATED] See the new edition:

Home Page:http://ipython-books.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Depreciated warning in Section 1 > Recipe 2

sami10007 opened this issue · comments

commented

Run pd.rolling_mean(df['Berri1'], n).dropna().plot(); and you get


/usr/local/lib/python2.7/dist-packages/ipykernel/__main__.py:6: FutureWarning: pd.rolling_mean is deprecated for Series and will be removed in a future version, replace with 
    Series.rolling(window=15,center=False).mean()

How can you do the replacement with Series.rolling(...).mean()?

Can you try:

df['Berri1'].rolling(window=n).mean().dropna().plot()

(this is untested)

If it works, please feel free to send a Pull Request!