[SciPy-user] moving average, moving standard deviation, etc...

A. M. Archibald peridot.faceted at gmail.com
Sat Dec 23 13:07:19 CST 2006

On 23/12/06, Matt Knox <mattknox_ca at hotmail.com> wrote:

> And similarly for moving average, and so forth. Is their a general way to do these kind of things? Or would it have to be a special case for each type of calculation to avoid looping?

I don't imagine it would be particularly efficient, but you could use
fancy indexing (or some weird code I posted a few months ago to avoid
copying) to construct a new array such that slices along one axis are
the (overlapping) chunks of the original array. Then any operation you
want to perform on all the chunks can just be performed along this
axis of the new array.

A. M. Archibald

More information about the SciPy-user mailing list