Moving Average Pandas
The rolling mean returns a Series you only have to add it as a new column of your DataFrame (MA) as described below. For information, the rolling_mean function has been deprecated in pandas newer versions. I have used the new method in my example, see below a quote from the pandas documentation. Warning Prior to version 0.18.0, pd.rolling_*, pd.expanding_*, and pd.ewm* were module level functions and are … Read more