fork(4) download
  1. import numpy as np
  2.  
  3. source = np.array(
  4. [[0, 7, 2, 3, 6, 7, 8, 9, 12, 13, 14, 15, 18, 19, 20, 21],
  5. [24, 25, 26, 27, 30, 31, 32, 33, 36, 37, 38, 39, 42, 43, 44, 45],
  6. [1, 2, 3, 5, 0, 5, 3, 6, 14, 55, 99, 66, 5, 87, 65, 45]]
  7. )
  8.  
  9. result = source.reshape(3, 4, 4)
  10. print(result)
Success #stdin #stdout 0.09s 24992KB
stdin
Standard input is empty
stdout
[[[ 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]]]