Reputation: 10709
I'm sure this is a really simple question, but I can't seem to find the answer. How can I get a count on the number of integers in a numpy array? I suspect there is a built-in count() method? Here is an example of what I am looking for:
>>> x = numpy.array([1, 2, 3, 4, 5])
>>> numpy.count(x)
5
Thanks for the help!
Upvotes: 0
Views: 625
Reputation: 2749
size provides the number of elements in an array. e.g. x.size
Upvotes: 3