I have an array shape =(64, 64,64) I want to divide it in 8 blocks like the image, each array shape would be then (32,32,32). How do I achieve this?
2 Answers
You might reshape your array as follows:
import numpy as np
a = np.random.randn(64, 64, 64)
b = a.reshape((-1, 32, 32, 32))
You'll then see b.shape being equal to (8, 32, 32, 32).