Answers for "dataframe series average"

5

rolling average df

df['pandas_SMA_3'] = df.iloc[:,1].rolling(window=3).mean()
Posted by: Guest on April-14-2020
1

return mean of df as dataframe

df.mean().to_frame().T
Posted by: Guest on May-26-2021

Python Answers by Framework

Browse Popular Code Answers by Language