Is there a SciPy function or NumPy function or module for Python that calculates the running mean of a 1D array given a specific window?
How about a moving average filter? It is also a one-liner and has the advantage, that you can easily manipulate the window type if you need something else than the rectangle, ie. a N-long simple moving average of an array a:
lfilter(np.ones(N)/N, [1], a)[N:]
And with the triangular window applied:
lfilter(np.ones(N)*scipy.signal.triang(N)/N, [1], a)[N:]
Note: I usually discard the first N samples as bogus hence [N:]
at the end, but it is not necessary and the matter of a personal choice only.