NumPy arrays are first iterated over the leftmost axis. Thus, if B has the form (2,3,4), then B[0] has the form (3,4) and B[1] has the form (3,4). In this sense, you could think of B as 2 arrays of form (3,4). You can see two arrays in edition B :
In [233]: B = np.arange(2*3*4).reshape((2,3,4)) array([[[ 0, 1, 2, 3], [ 4, 5, 6, 7], <-- first (3,4) array [ 8, 9, 10, 11]], [[12, 13, 14, 15], [16, 17, 18, 19], <-- second (3,4) array [20, 21, 22, 23]]])
You can also think of B as four 2x3 arrays, iterating over the first index first:
for i in range(4): print(B[:,:,i]) # [[ 0 4 8] # [12 16 20]] # [[ 1 5 9] # [13 17 21]] # [[ 2 6 10] # [14 18 22]] # [[ 3 7 11] # [15 19 23]]
but you can just as easily think of B as three 2x4 arrays:
for i in range(3): print(B[:,i,:]) # [[ 0 1 2 3] # [12 13 14 15]] # [[ 4 5 6 7] # [16 17 18 19]] # [[ 8 9 10 11] # [20 21 22 23]]
NumPy arrays are completely flexible. But as for repr of B , what you see corresponds to two (3x4) arrays, since B iterates along the left-most axis.
for arr in B: print(arr) # [[ 0 1 2 3] # [ 4 5 6 7] # [ 8 9 10 11]] # [[12 13 14 15] # [16 17 18 19] # [20 21 22 23]]