Home > other >  Help: pandas batch computing moving average is added to the new column, how to operate?
Help: pandas batch computing moving average is added to the new column, how to operate?

Time:10-02

The import numpy as np, pandas as pd
S=pd. Series (np) arange (100)
C=10
Cp=np. Empty ([c], 100, dtype=int)
For I in range (1, c) :
Cp [, I]=pd. S.r olling (3 * I). The mean () # I want to put rolling average 3-9 data in the columns of the cp, how to operate?
Print (cp)

Turned out to be in VB language, now feel in python is very concise, but grammar is not familiar with, also please help, thanks a lot!

CodePudding user response:

By ~ ~, pursuing big cafe taught,
  • Related