04 / 04

What are the attributes of array in numpy?

ndim, shape, size, and dtype are the attributes of an array.

The number of dimensions of an array is contained in the ndim attribute.
The shape of an array is a tuple of non-negative integers that specify the number of elements along each dimension.
The total number of elements in array is contained in the size attribute.
Arrays are typically “homogeneous”, meaning that they contain elements of only one “data type”. The data type is recorded in the dtype attribute.