diff options
author | mattip <matti.picus@gmail.com> | 2019-07-09 00:13:12 -0500 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-07-09 00:19:28 -0500 |
commit | d8e145743813545b11be1f588f4fedb88addf059 (patch) | |
tree | 6d85b6f4c61e76757b2cf4623e1e91f5310dad81 /doc/source/reference/random/index.rst | |
parent | af5a108475fe1969f2b5ee2e0ec81ddc278f6437 (diff) | |
download | numpy-d8e145743813545b11be1f588f4fedb88addf059.tar.gz |
DOC: emphasize random API changes
Diffstat (limited to 'doc/source/reference/random/index.rst')
-rw-r--r-- | doc/source/reference/random/index.rst | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/doc/source/reference/random/index.rst b/doc/source/reference/random/index.rst index 51e72513d..7de1c838c 100644 --- a/doc/source/reference/random/index.rst +++ b/doc/source/reference/random/index.rst @@ -41,10 +41,28 @@ statistically more reliable than the legacy methods in `~.RandomState` from numpy import random random.standard_normal() -`~Generator` can be used as a direct replacement for `~.RandomState`, although -the random values are generated by `~.PCG64`. The -`~Generator` holds an instance of a BitGenerator. It is accessible as -``gen.bit_generator``. +`~Generator` can be used as a replacement for `~.RandomState`. Both class +instances now hold a internal `BitGenerator` instance to provide the bit +stream, it is accessible as ``gen.bit_generator``. Some long-overdue API +cleanup means that legacy and compatibility methods have been removed from +`~.Generator` + +=================== ============== ============ +`~.RandomState` `~.Generator` Notes +------------------- -------------- ------------ +``random_sample``, ``random`` Compatible with `random.random` +``rand`` +------------------- -------------- ------------ +``randint``, ``integers`` Add an ``endpoint`` kwarg +``random_integers`` +------------------- -------------- ------------ +``tomaxint`` removed Use ``integers(0, np.iinfo(np.int).max,`` + ``endpoint=False)`` +------------------- -------------- ------------ +``seed`` removed Use `~.SeedSequence.spawn` +=================== ============== ============ + +See `new-or-different` for more information .. code-block:: python |