pandas里怎么求一个dataframe里一列的移动平均数?
谢谢!
2个回答
moving_mean = df['a'].rolling(window=3).mean()
pandas里的rolling可以用rolling sum也可以rolling mean
pandas里怎么求一个dataframe里一列的移动平均数?
谢谢!
moving_mean = df['a'].rolling(window=3).mean()
pandas里的rolling可以用rolling sum也可以rolling mean