It's easier to visualise this in 2D. Look at this array with shape (4, 3):
import numpy as np
a = np.array([[ 1, 2, 3],
[ 4, 5, 6],
[ 7, 8, 9],
[10, 11, 12]])
Taking a slice a[:,0]
will return a 1D array along axis 0:
>>> a[:,0]
array([ 1, 4, 7, 10])
As will slice a[:,1]
:
>>> a[:,1]
array([ 2, 5, 8, 11])
And slice a[:,2]
:
>>> a[:,2]
array([ 3, 6, 9, 12])
So you can't really say that along axis 0 there are only 4 values, because as you can see all of the 12 values stored in the array are available along axis 0. The shape
of an array rather describes the length of it's axes, not how many values are stored along it.
So if you really looking for 4 values along axis 0, you have to decide which one of the slices you want. In the case this is not exactly what you want to achieve, please refine your question.