operation on blocks of a matrix efficiently in python
You can iterate over the array and just call numpy.average on the 5x5 blocks ?
Let's say I have 100x200 numpy array of random numbers and wish to average blocks of 5x5 in the this array, that is I need the operation to be done on all 800 distinct blocks that are 5x5. I wonder if there is an efficient way to do this without nested loop and possibly without any loop.