In the week 2 lab following Vectorisation part 2, we use NumPy to view the shape of an array, for various arrays. I am confused because for a 1-dimensional array, calling the shape using .shape results in something like (n,), or (4,) when the number of columns is 4, whereas for 2-dimensional arrays the shape is printed in the format (m, n) where m is the number of rows and n the number of columns. I would therefore expect the result of . shape called on a 1-dimensional array to be in the format (, n) rather than (n,). Or for the above example (, 4).

For the shape of an array, it should be note that each of the shape is corresponding to the dimension of the array. For 1-d array, the dimensions count from 0 (first dimension), then the shape (N,) or shape at 0 is N.