@@ -20,27 +20,27 @@ Since Numpy version 1.17.0 the Generator can be initialized with a
20
20
number of different BitGenerators. It exposes many different probability
21
21
distributions. See `NEP 19 <https://www.numpy.org/neps/
22
22
nep-0019-rng-policy.html> `_ for context on the updated random Numpy number
23
- routines. The legacy `~ RandomState ` random number routines are still
23
+ routines. The legacy `. RandomState ` random number routines are still
24
24
available, but limited to a single BitGenerator.
25
25
26
- For convenience and backward compatibility, a single `~RandomState `
26
+ For convenience and backward compatibility, a single `~. RandomState `
27
27
instance's methods are imported into the numpy.random namespace, see
28
28
:ref: `legacy ` for the complete list.
29
29
30
30
Quick Start
31
31
-----------
32
32
33
- By default, `~Generator ` uses normals provided by `~PCG64 ` which will be
34
- statistically more reliable than the legacy methods in `~RandomState `
33
+ By default, `~Generator ` uses normals provided by `~pcg64. PCG64 ` which will be
34
+ statistically more reliable than the legacy methods in `~. RandomState `
35
35
36
36
.. code-block :: python
37
37
38
38
# Uses the old numpy.random.RandomState
39
39
from numpy import random
40
40
random.standard_normal()
41
41
42
- `~Generator ` can be used as a direct replacement for `~RandomState `, although
43
- the random values are generated by `~PCG64 `. The
42
+ `~Generator ` can be used as a direct replacement for `~. RandomState `, although
43
+ the random values are generated by `~. PCG64 `. The
44
44
`~Generator ` holds an instance of a BitGenerator. It is accessible as
45
45
``gen.bit_generator ``.
46
46
@@ -66,7 +66,7 @@ is wrapped with a `~.Generator`.
66
66
Introduction
67
67
------------
68
68
The new infrastructure takes a different approach to producing random numbers
69
- from the `RandomState ` object. Random number generation is separated into
69
+ from the `~. RandomState ` object. Random number generation is separated into
70
70
two components, a bit generator and a random generator.
71
71
72
72
The `BitGenerator ` has a limited set of responsibilities. It manages state
@@ -79,8 +79,8 @@ distributions, e.g., simulated normal random values. This structure allows
79
79
alternative bit generators to be used with little code duplication.
80
80
81
81
The `Generator ` is the user-facing object that is nearly identical to
82
- `RandomState `. The canonical method to initialize a generator passes a
83
- `~pcg64 .PCG64 ` bit generator as the sole argument.
82
+ `. RandomState `. The canonical method to initialize a generator passes a
83
+ `~.PCG64 ` bit generator as the sole argument.
84
84
85
85
.. code-block :: python
86
86
@@ -105,9 +105,9 @@ What's New or Different
105
105
The Box-Muller method used to produce NumPy's normals is no longer available
106
106
in `Generator `. It is not possible to reproduce the exact random
107
107
values using Generator for the normal distribution or any other
108
- distribution that relies on the normal such as the `numpy.random .gamma ` or
109
- `numpy.random .standard_t `. If you require bitwise backward compatible
110
- streams, use `RandomState `.
108
+ distribution that relies on the normal such as the `.RandomState .gamma ` or
109
+ `.RandomState .standard_t `. If you require bitwise backward compatible
110
+ streams, use `. RandomState `.
111
111
112
112
* The Generator's normal, exponential and gamma functions use 256-step Ziggurat
113
113
methods which are 2-10 times faster than NumPy's Box-Muller or inverse CDF
@@ -121,9 +121,8 @@ What's New or Different
121
121
source of randomness that is used in cryptographic applications (e.g.,
122
122
``/dev/urandom `` on Unix).
123
123
* All BitGenerators can produce doubles, uint64s and uint32s via CTypes
124
- (`~PCG64.ctypes `) and CFFI
125
- (:meth: `~PCG64.cffi `). This allows the bit generators to
126
- be used in numba.
124
+ (`~.PCG64.ctypes `) and CFFI (`~.PCG64.cffi `). This allows the bit generators
125
+ to be used in numba.
127
126
* The bit generators can be used in downstream projects via
128
127
:ref: `Cython <randomgen_cython >`.
129
128
* `~.Generator.integers ` is now the canonical way to generate integer
@@ -132,8 +131,9 @@ What's New or Different
132
131
The ``endpoint `` keyword can be used to specify open or closed intervals.
133
132
This replaces both ``randint `` and the deprecated ``random_integers ``.
134
133
* `~.Generator.random ` is now the canonical way to generate floating-point
135
- random numbers, which replaces `random_sample `, `sample `, and `ranf `. This
136
- is consistent with Python's `random.random `.
134
+ random numbers, which replaces `.RandomState.random_sample `,
135
+ `.RandomState.sample `, and `.RandomState.ranf `. This is consistent with
136
+ Python's `random.random `.
137
137
* All BitGenerators in numpy use `~SeedSequence ` to convert seeds into
138
138
initialized states.
139
139
0 commit comments