0

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.

Masoud Ghaderi
  • 437
  • 5
  • 16

1 Answers1

0

You can iterate over the array and just call numpy.average on the 5x5 blocks ?

Bierbarbar
  • 1,399
  • 15
  • 35