Can someone explain exactly what the axis
parameter in NumPy does?
I am terribly confused.
I\'m trying to use the function myArray.sum(ax
To understand the axis
intuitively, refer the picture below (source: Physics Dept, Cornell Uni)
The shape of the (boolean) array in the above figure is shape=(8, 3)
. ndarray.shape will return a tuple where the entries correspond to the length of the particular dimension. In our example, 8
corresponds to length of axis 0 whereas 3
corresponds to length of axis 1.