Shape ¶
ndarray.shape
: the dimensions of the array.
This is a tuple of integers indicating the size of the array in each dimension.
For a matrix with
n
rows and
m
columns, shape will be
(n, m)
.
The length of the shape tuple is therefore the number of axes,
ndim
.
The shape of a NumPy array is a
tuple
that describes the size of each dimension of the array.
It provides information about the number of elements along each axis.