Python Forum
Newbie question on how to use pandas.rolling_mean
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie question on how to use pandas.rolling_mean
#1
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,
Reply


Messages In This Thread
Newbie question on how to use pandas.rolling_mean - by zydjohn - Dec-09-2017, 07:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pandas df inside a df question mbaker_wv 4 1,266 Dec-25-2022, 01:11 AM
Last Post: mbaker_wv
  Pandas usecols question rsearing 1 1,313 Aug-20-2022, 10:10 PM
Last Post: jefsummers
  Simple pandas question mcva 4 2,750 Dec-17-2021, 04:47 PM
Last Post: mcva
  Pandas question new2datasci 0 2,029 Jan-10-2021, 01:29 AM
Last Post: new2datasci
  Pandas merge question smw10c 2 5,834 Jul-02-2020, 06:56 PM
Last Post: hussainmujtaba
  Counting Criteria in Pandas Question Koenig 1 2,246 Sep-30-2019, 05:16 AM
Last Post: perfringo
  Function question using Pandas smw10c 7 7,286 Feb-12-2019, 06:52 PM
Last Post: Nathandsn
  Simple pandas dataframe question popohoma 1 3,631 Jan-03-2019, 05:00 PM
Last Post: ashlardev
  question on pandas datareader kit12_31 3 9,386 Feb-05-2018, 11:55 PM
Last Post: snippsat
  Newbie question to return only the index of a dataframe zydjohn 0 2,632 Jan-22-2018, 03:40 PM
Last Post: zydjohn

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020