[Numpy-discussion] ndarray.count() ?
robert.kern at gmail.com
Thu Sep 7 17:57:00 CDT 2006
> Charles R Harris <charlesr.harris at gmail.com> [2006-09-07 15:04]:
>> I don't know about count, but you can gin up something like this
>> In : a = ran.randint(0,2, size=(10,))
>> In : a
>> Out: array([0, 1, 0, 1, 1, 0, 0, 1, 1, 1])
> This exposed inconsistent randint() behavior between SciPy and the Python
> random module. The Python randint includes the upper endpoint. The SciPy
> version excludes it.
numpy.random.random_integers() includes the upper bound, if you like.
numpy.random does not try to emulate the standard library's random module.
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion