import numpy as np
import matplotlib.pyplot as plt
def cummean(x):
= np.size(x)
N = np.zeros(N) # np.zeros_like(x)
out = 0
s for n in range(N):
+= x[n]
s = s / (n + 1)
out[n] return out
= np.random.default_rng()
rng = rng.normal(size = 100) x
100), cummean(x)) plt.plot(np.arange(