bundles / numpy 2.4.3 / numpy / ma / core / size
function
numpy.ma.core:size
source: /numpy/ma/core.py :7764
Signature
def size ( obj , axis = None ) Summary
Return the number of elements along a given axis.
Parameters
a: array_likeInput data.
axis: None or int or tuple of ints, optionalAxis or axes along which the elements are counted. By default, give the total number of elements.
Returns
element_count: intNumber of elements along the specified axis.
Examples
import numpy as np a = np.array([[1,2,3],[4,5,6]]) np.size(a) np.size(a,axis=1) np.size(a,axis=0) np.size(a,axis=(0,1))
See also
- ndarray.shape
dimensions of array
- ndarray.size
number of elements in array
- shape
dimensions of array
Aliases
-
numpy.ma.size