summaryrefslogtreecommitdiff
path: root/doc/source/reference
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2019-07-09 00:13:12 -0500
committermattip <matti.picus@gmail.com>2019-07-09 00:19:28 -0500
commitd8e145743813545b11be1f588f4fedb88addf059 (patch)
tree6d85b6f4c61e76757b2cf4623e1e91f5310dad81 /doc/source/reference
parentaf5a108475fe1969f2b5ee2e0ec81ddc278f6437 (diff)
downloadnumpy-d8e145743813545b11be1f588f4fedb88addf059.tar.gz
DOC: emphasize random API changes
Diffstat (limited to 'doc/source/reference')
-rw-r--r--doc/source/reference/random/index.rst26
-rw-r--r--doc/source/reference/random/new-or-different.rst8
2 files changed, 27 insertions, 7 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
diff --git a/doc/source/reference/random/new-or-different.rst b/doc/source/reference/random/new-or-different.rst
index 4eb175d57..5442f46c9 100644
--- a/doc/source/reference/random/new-or-different.rst
+++ b/doc/source/reference/random/new-or-different.rst
@@ -23,10 +23,12 @@ Feature Older Equivalent Notes
source, called a `BitGenerator
<bit_generators>` A number of these
are provided. ``RandomState`` uses
- only the Mersenne Twister.
+ the Mersenne Twister `~.MT19937` by
+ default, but can also be instantiated
+ with any BitGenerator.
------------------ -------------------- -------------
-``random`` ``random_sample`` Access the values in a BitGenerator,
- convert them to ``float64`` in the
+``random`` ``random_sample``, Access the values in a BitGenerator,
+ ``rand`` convert them to ``float64`` in the
interval ``[0.0.,`` `` 1.0)``.
In addition to the ``size`` kwarg, now
supports ``dtype='d'`` or ``dtype='f'``,