How to update an array of exponential moving average in pandas?
<p>I'm using <code>pandas.ewma</code> to compute the exponential moving average of a time series. As new data are appended to the time series, I also need to update its exponential moving average array. How can I do this, without recomputing exponential moving average from the beginning of the time series.</p>

<p>Here's my example code</p>

<pre><code>ema = pd.ewma(ts, span = 10)
ts = np.append(ts, [25], 0)
# I would not like to do this to update ema since all of the ema except the last one have already been computed:
ema = pd.ewma(ts, span = 10)
</code></pre>