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!
size provides the number of elements in an array. e.g. x.size
精彩评论