How to calculate the Exponential Moving Average (EMA) through record iterations in pandas dataframe I have created a pandas dataframe as follows: