
The N-dimensional array (ndarray) — NumPy v2.4 Manual
The number of dimensions and items in an array is defined by its shape, which is a tuple of N non-negative integers that specify the sizes of each dimension. The type of items in the array is …
numpy.ndarray.ndim — NumPy v2.4 Manual
numpy.ndarray.ndim # attribute ndarray.ndim # Number of array dimensions. Examples Try it in your browser!
numpy.ndarray.size — NumPy v2.4 Manual
numpy.ndarray.size # attribute ndarray.size # Number of elements in the array. Equal to np.prod(a.shape), i.e., the product of the array’s dimensions. Notes a.size returns a standard …
NumPy quickstart — NumPy v2.5.dev0 Manual
NumPy’s main object is the homogeneous multidimensional array. It is a table of elements (usually numbers), all of the same type, indexed by a tuple of non-negative integers.
NumPy: the absolute basics for beginners — NumPy v2.5.dev0 …
In NumPy, a dimension of an array is sometimes referred to as an “axis”. This terminology may be useful to disambiguate between the dimensionality of an array and the dimensionality of the …
numpy.size — NumPy v2.4 Manual
numpy.size # numpy.size(a, axis=None) [source] # Return the number of elements along a given axis. Parameters: aarray_like Input data. axisNone or int or tuple of ints, optional Axis or axes …
numpy.ndarray.shape — NumPy v2.4 Manual
Tuple of array dimensions. The shape property is usually used to get the current shape of an array, but may also be used to reshape the array in-place by assigning a tuple of array …
Broadcasting — NumPy v2.4 Manual
General broadcasting rules # When operating on two arrays, NumPy compares their shapes element-wise. It starts with the trailing (i.e. rightmost) dimension and works its way left. Two …
Array creation — NumPy v2.4 Manual
The ndarray creation functions can create arrays with any dimension by specifying how many dimensions and length along that dimension in a tuple or list. numpy.zeros will create an array …
numpy.expand_dims — NumPy v2.4 Manual
numpy.expand_dims # numpy.expand_dims(a, axis) [source] # Expand the shape of an array. Insert a new axis that will appear at the axis position in the expanded array shape. …