Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame({'Q': [0, 4, 5, np.nan, 8]})
df
Out[2]:
Q
0 0.0
1 4.0
2 5.0
3 NaN
4 8.0
In [3]:
df.ewm(com=0.4).mean()
Out[3]:
Q
0 0.000000
1 3.111111
2 4.492537
3 4.492537
4 7.647808