import numpy as np source = np.array( [[0, 7, 2, 3, 6, 7, 8, 9, 12, 13, 14, 15, 18, 19, 20, 21], [24, 25, 26, 27, 30, 31, 32, 33, 36, 37, 38, 39, 42, 43, 44, 45], [1, 2, 3, 5, 0, 5, 3, 6, 14, 55, 99, 66, 5, 87, 65, 45]] ) result = source.reshape(3, 4, 4) print(result)