I\'m trying to using numpy.lib.stride_tricks.as_strided to iterate over non-overlapping blocks of an array, but I\'m having trouble finding documentation of the parameters,
scikit-image has a function named view_as_blocks() that does almost what you need. The only problem is that it has an extra assert that forbids your use case, since your blocks don't divide evenly into your array shape. But in your case, the assert isn't necessary, so you can copy the function source code and safely remove the pesky assert yourself.