On Sat, Oct 30, 2021 at 9:44 PM Todd Anderson <[email protected]> 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 -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ > Member address: [email protected] >
_______________________________________________ NumPy-Discussion mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: [email protected]
