Numpy size() function | Python
In Python, numpy.size() function count the number of elements along a given axis.
Syntax: numpy.size(arr, axis=None)
arr: [array_like] Input data.
axis: [int, optional] Axis(x,y,z) along which the elements(rows or columns) are counted. By default, give the total number of elements in a array
Returns: [int] Return the number of elements along a given axis.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Code #1 :
Code #2 :