On Sat, Oct 30, 2021 at 9:44 PM Todd Anderson <drtod...@comcast.net> wrote:

> Some NumPy random number generation functions take a dtype parameter
> whereas others don't.  Some of them take an out parameter whereas others
> don't.  Just glancing at it, there seems to be no rhyme or reason why this
> would be the case but is there some hidden consistency underneath the hood
> to explain why some have these params and others don't?  Is there any
> reason that things like random.randn and numpy.random.Generator.normal
> don't take a dtype and out parameters?


Let's not compare the legacy and the new API, the former is what it is by
now. The Generator API does indeed look a little inconsistent though.
There's not many methods, see
https://numpy.org/devdocs/reference/random/generator.html#simple-random-data.
Basic methods like `integers` and `random` should be consistent I'd think,
so one having an out= keyword and the other not is a little odd.

Cheers,
Ralf


> If I need to create a huge array of random numbers whose dtype is float16
> or float32 then what is the BKM to do this when the routine I would like to
> use generates an array of float64 and with the 64-bit data type the array
> won't fit in memory?
> _______________________________________________
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: ralf.gomm...@gmail.com
>
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to