Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

size of a NumPy array in Python

a = np.arange(3)
b = np.arange(12).reshape((3, 4))
c = np.arange(24).reshape((2, 3, 4))

# it returns the total number of elements
print(a.size) # 3
print(b.size) # 12
print(c.size) # 24
Source by numpy.org #
 
PREVIOUS NEXT
Tagged: #size #NumPy #array #Python
ADD COMMENT
Topic
Name
9+8 =