1
import pandas as pd
df = pd.DataFrame({'a':[1,2,3,4,5,6,7,8,9,10],
           'b':[11,12,13,14,15,16,17,18,19,20],
                          })

pd.rolling_mean(df,window = 2)

AttributeError: module 'pandas' has no attribute 'rolling_mean'

pandas document http://pandas.pydata.org/pandas-docs/version/0.17.0/generated/pandas.rolling_mean.html

I do know why i get this error, pandas docement show this information. And I can not use it ? Indeed,all the method like this happened same problem eg:(pandas.rolling_median) (pandas.rolling_var)

By the way, argument ''window'' , how to use it?

kovac
  • 307
  • 4
  • 11
  • 1
    In current versions [it is now](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rolling.html) `rolling(window=2).mean()`. – Ami Tavory May 21 '18 at 18:26
  • which pandas version are you using? – nandal May 21 '18 at 18:26
  • how can i search the pandas document that i need – kovac May 21 '18 at 18:29
  • import pandas as pd print pd.__version__ – nandal May 21 '18 at 18:32
  • Pandas also provides a utility function, pd.show_versions(), which reports the version of its dependencies as well, reference:- https://stackoverflow.com/questions/20612645/how-to-find-the-installed-pandas-version – nandal May 21 '18 at 18:33

0 Answers0