def numpy_ewma_vectorized(data, window):
    alpha = (2 / (window + 1.0))
    alpha_rev = (1 - alpha)
    n = data.shape[0]
    pows = (alpha_rev ** np.arange((n + 1)))
    scale_arr = (1 / pows[:(- 1)])
    offset = (data[0] * pows[1:])
    pw0 = (alpha * (alpha_rev ** (n - 1)))
    mult = ((data * pw0) * scale_arr)
    cumsums = mult.cumsum()
    out = (offset + (cumsums * scale_arr[::(- 1)]))
    return out
def numpy_ewma_vectorized(data, window):
    alpha = (2 / (window + 1.0))
    alpha_rev = (1 - alpha)
    n = data.shape[0]
    pows = (alpha_rev ** np.arange((n + 1)))
    scale_arr = (1 / pows[:(- 1)])
    offset = (data[0] * pows[1:])
    pw0 = (alpha * (alpha_rev ** (n - 1)))
    mult = ((data * pw0) * scale_arr)
    cumsums = mult.cumsum()
    out = (offset + (cumsums * scale_arr[::(- 1)]))
    return out