title: pandas exponential moving average (EMA)
body: <pre><code># close = [1332.45, 1330.95, 1332.25, 1331.1, 1336.3, 1330.0, 1330.8, 1333.0, 1332.35, 1335.55, 1333.1, 1334.0, 1333.15, 1334.8, 1333.2, 1334.0, 1334.0, 1333.0, 1334.85, 1336.0, 1334.7, 1333.25, 1332.0, 1333.4, 1333.15, 1334.5, 1336.95, 1340.0, 1344.7, 1344.5, 1348.15, 1345.15, 1346.85, 1346.0, 1343.1, 1341.0, 1340.0, 1341.0, 1343.8, 1343.4, 1343.0, 1342.1, 1340.5, 1342.4, 1341.7, 1340.25, 1340.3, 1341.0, 1340.5, 1340.5]
  
  # actual_ema = [nan, nan, 1331.8833333333334, 1331.4916666666668, 1333.8958333333335, 1331.9479166666667, 1331.3739583333333, 1332.1869791666668, 1332.2684895833333, 1333.9092447916667, 1333.5046223958334, 1333.7523111979167, 1333.4511555989584, 1334.1255777994793, 1333.6627888997396, 1333.8313944498698, 1333.9156972249348, 1333.4578486124674, 1334.1539243062336, 1335.0769621531167, 1334.8884810765585, 1334.0692405382792, 1333.0346202691396, 1333.2173101345697, 1333.183655067285, 1333.8418275336426, 1335.3959137668212, 1337.6979568834106, 1341.1989784417053, 1342.8494892208528, 1345.4997446104264, 1345.3248723052134, 1346.0874361526066, 1346.0437180763033, 1344.5718590381516, 1342.7859295190758, 1341.3929647595378, 1341.196482379769, 1342.4982411898845, 1342.9491205949423, 1342.9745602974713, 1342.5372801487356, 1341.5186400743678, 1341.959320037184, 1341.829660018592, 1341.039830009296, 1340.669915004648, 1340.834957502324, 1340.667478751162, 1340.583739375581]
  
  pandas_ema = df.close.ewm(span=3, min_periods=3, adjust=False, ignore_na=True).mean()
  # [nan, nan, 1331.975, 1331.5375, 1333.9187499999998, 1331.959375, 1331.3796874999998, 1332.18984375, 1332.269921875, 1333.9099609374998, 1333.5049804687499, 1333.7524902343748, 1333.4512451171875, 1334.1256225585937, 1333.6628112792969, 1333.8314056396484, 1333.9157028198242, 1333.457851409912, 1334.153925704956, 1335.0769628524781, 1334.8884814262392, 1334.0692407131196, 1333.0346203565598, 1333.21731017828, 1333.18365508914, 1333.8418275445702, 1335.395913772285, 1337.6979568861425, 1341.1989784430712, 1342.8494892215356, 1345.4997446107677, 1345.324872305384, 1346.087436152692, 1346.043718076346, 1344.571859038173, 1342.7859295190865, 1341.3929647595432, 1341.1964823797716, 1342.498241189886, 1342.949120594943, 1342.9745602974715, 1342.5372801487356, 1341.5186400743678, 1341.959320037184, 1341.829660018592, 1341.039830009296, 1340.669915004648, 1340.834957502324, 1340.667478751162, 1340.583739375581]
  </code></pre>
  <p>What I am doing wrong? How to calculate ema in pandas?</p>