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

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


On Tue, Jan 19, 2016 at 10:27 AM, Charles R Harris <
charlesr.harris at gmail.com> wrote:

>
>
> 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...
>
>
Note that we also have both arange and linspace for floats. What works well
for integers is not always the best for floats.

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


More information about the NumPy-Discussion mailing list