Previous topic


Next topic


This Page


mov_average_expw(data, span, tol=9.9999999999999995e-07, dtype=None)

Calculates the exponentially weighted moving average of a series.


data : array-like

Input data, as a sequence or (subclass of) ndarray. Masked arrays and TimeSeries objects are also accepted. The input array should be 1D or 2D at most. If the input array is 2D, the function is applied on each column.

span : int

Time periods. The smoothing factor is 2/(span + 1)

tol : {1e-6, float}, optional

Tolerance for the definition of the mask. When data contains masked values, this parameter determines what points in the result should be masked. Values in the result that would not be “significantly” impacted (as determined by this parameter) by the masked values are left unmasked.

dtype : dtype, optional

Data type of the result.


result :

The result is always a masked array (preserves subclass attributes).