I've just started using NumPy and I get that this is a very basic and wierd thing to point out but I noticed that the shape function acts differently when called on a 1D array vs when called on a 2D array.
Here's how it returns the results in 1D array -
arr=np.array([1,2,3])
arr.shape
OUTPUT - (3,)
In this the number of columns is represented before the " , " ie its represented as (columns,)
And here's how it returns the results in 2D array -
arr1=np.array([[1,2,3,],[4,5,6]])
arr1.shape
OUTPUT - (2,3)
In this the number of columns is represented after the " , ". ie its represented as (rows,columns).
This is not something that effects its functionality or its usefulness but I was still wondering why it returns the output in case of a 1D array in that way. Even if the shape is 1D and the number of rows is left blank, why does the number of columns appear before the " , " ?