[Numpy-discussion] Behavior of np.random.uniform

Charles R Harris charlesr.harris at gmail.com
Tue Jan 19 12:27:03 EST 2016


On Tue, Jan 19, 2016 at 9:23 AM, Chris Barker - NOAA Federal <
chris.barker at noaa.gov> wrote:

> What does the standard lib do for rand range? I see that randint Is closed
> on both ends, so order doesn't matter, though if it raises for b<a, then
> that's a precedent we could follow.
>

randint is not closed on the high end. The now deprecated random_integers
is the function that does that.

For floats, it's good to have various interval options. For instance, in
generating numbers that will be inverted or have their log taken it is good
to avoid zero. However, the names 'low' and 'high' are misleading...

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20160119/e67b2495/attachment.html>


More information about the NumPy-Discussion mailing list