A.shape will return a tuple (m, n), where m is the number of rows, and n is the number of columns.
A.shape will return a tuple (m, n), where m is the number of rows, and n is the number of columns.
rows, columns are just the names we give, by convention, to the 2 dimensions of a matrix (or more generally a 2d numpy array).
np.matrix is, by definition, 2d, so this convention is useful. But np.array may have 0, 1, 2 or more dimensions. For that these 2 names are less useful. For example if 1d, does it have rows or columns? If 3d, what do we call the last dimension, depth? or maybe the first is pages?
So don't put too much emphasis on the names. Most numpy functions ask you to specify the 'axis', by number, 0, 1, 2 etc., not by name.
There may be further confusion if you load data from a csv file, and get a 1d array (one 'row' per line of the file) of dtype fields. Are fields the same as columns? Sort of, but not quite.
The format is (m, n) where m is the number of rows and n is the number of columns for a 2d array.
HOWEVER your case is a 1d array, which is why you get (m,). This basically means it's neither rows nor columns, just five items, like a list. There is no second dimension in this case. If you wanted to add a second dimension, there are a bunch of functtions that just happen to slip my mind
In numpy, the shape tuple returns a tuple (m, n), m refers to the "number of rows", whereas n refers to the number of columns.
So (5, 1) would be 5 rows and one column.
And (5,) is just a 1d array, 5 rows... But a 1d vector doesn't isn't referred by the number of columns and rows, since it isn't nested. It's just an array with five elements.
As @TimRoberts mentioned, numpy arrays can have an arbitrary number of dimensions. Such as images, with a shape of a tuple with 3 elements, which is rows, columns and channels, for RGB it would have 3 channels, and for RGBA it would be 4 channels. This would be an example of an 3d array.