Dec-09-2017, 07:29 PM
import pandas as pd data = [1.0, 2.0, 3.0, 4.0] rollmean_data_2 = pd.rolling_mean(data, 2) print(rollmean_data_2)I want to learn how to use rolling_mean by pandas, the pandas version is 0.21.0.
But when I run the above code, I got the following error:
AttributeError: 'list' object has no attribue 'rolling'
Please show me how to use pandas.rolling_mean
Or if other python package has the similar function, please also advise how to use them.
Thanks,