B[:, :] = np.dot(B[:, :], np.array([[0, 1], [1, 0]]))
print(A)
print(B[1, 1])
C = B.reshape(3, 3, -1)
print(C.sum(-1))
How can I efficiently process a numpy array in blocks similar to Matlab's blkproc (blockproc) function