dataframe shift(periods=1).rolling(3).mean() code example
Example: dataframe shift python
df.shift(2, axis = 0)
df.shift(-2, axis = 0)
df[c1] = df[c2].shift(2, axis = 0)
df[c1] = df[c2].shift(-2, axis = 0)
df.shift(2, axis = 0)
df.shift(-2, axis = 0)
df[c1] = df[c2].shift(2, axis = 0)
df[c1] = df[c2].shift(-2, axis = 0)