Previously I used the following to calculate the ewma
dataset[\'26ema\'] = pd.ewma(dataset[\'price\'], span=26)
But, in the latest version
Use Series.ewm:
dataset['price'].ewm(span=26)
See GH11603 for the relevant PR and mapping of the old API to new ones.
Minimal Code Example
s = pd.Series(range(5)) s.ewm(span=3).mean() 0 0.000000 1 0.666667 2 1.428571 3 2.266667 4 3.161290 dtype: float64