Because the docs say
a = com/(1 + com)
follows that
com = a/(1.0-a)
(for 0 <= a <1).
In addition, the values โโcalculated in the initial periods "to take into account the imbalance in relative weights" are adjusted. To confirm the formula

disable this setting:
z = pd.ewma(x, com=a/(1.0-a), adjust=False) print(z)
then prints
0 NaN 1 NaN 2 2.098920 3 3.850710 4 5.246548 5 6.344995
and this result can be mimicked by calculating
import pandas as pd import numpy as np import numpy.testing.utils as NTU nan = np.nan x = pd.Series([nan, nan, nan, 13.109292, 12.623850, 12.150520]) a = 0.8408964152537145 z = pd.ewma(x, com=a/(1.0-a), adjust=False) def nanzero(x): return 0 if np.isnan(x) else x x.ffill(inplace=True) y = [x[0]] for xt in x[1:]: yt1 = y[-1] if np.isnan(yt1) and np.isnan(xt): yt = nan else: yt1 = nanzero(yt1) xt = nanzero(xt) yt = a*yt1 + (1-a)*xt
source share