def _movingAverage(data, n):
    out = np.cumsum(data)
    out[n:] = out[n:] - out[:-n]
    return out[n - 1:] / n
Calculate the moving average from a time series.
dataset/ETHPy150Open nasa/RHEAS/src/drought.py/_movingAverage