Returns the number of elements in an ndarray.
Returns the number of elements matching the given predicate.