What number represent the rows and columns in the tuple returned by the form?
rows
, columns
are just the names we give, by convention, to the two dimensions of a matrix
(or more generally to a 2d numpy array).
np.matrix
is, by definition, 2d, so this convention is useful. But it np.array
can have 0, 1, 2 or more dimensions. For this, 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 pages?
So don't put too much emphasis on names. Most functions numpy
require you to specify "axis", number, 0, 1, 2, etc., rather than by name.
Additional confusion may arise if you load data from a csv file and get a 1d array (one line per line in the file) of dtype fields. Are the fields the same as columns? Sorting, but not quite.
source to share