diff options
author | Robert Kern <robert.kern@gmail.com> | 2023-04-19 23:16:42 -0400 |
---|---|---|
committer | Robert Kern <robert.kern@gmail.com> | 2023-04-19 23:16:42 -0400 |
commit | dd8f19177093cd43868e843c67762578d1955b4a (patch) | |
tree | 65125afa441c122a0421b3fadc4103f7d00998cc /doc/source | |
parent | 5749edbf3e708c7886f662b8827de73f99708ffb (diff) | |
download | numpy-dd8f19177093cd43868e843c67762578d1955b4a.tar.gz |
DOC: expand seeding wording.
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/reference/random/index.rst | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/doc/source/reference/random/index.rst b/doc/source/reference/random/index.rst index e960658f9..f62347cfe 100644 --- a/doc/source/reference/random/index.rst +++ b/doc/source/reference/random/index.rst @@ -33,11 +33,12 @@ different distributions. >>> rng.integers(low=0, high=10, size=5) #doctest: +SKIP array([8, 7, 6, 2, 0]) # may vary -Our RNGs are deterministic sequences and can be reproduced by specifying a seed to -control its initial state. By default, with no seed, `default_rng` will create -the RNG using nondeterministic data from the operating system and therefore -generate different numbers each time. The pseudorandom sequences will be -practically independent. +Our RNGs are deterministic sequences and can be reproduced by specifying a seed integer to +derive its initial state. By default, with no seed provided, `default_rng` will create +seed the RNG from nondeterministic data from the operating system and therefore +generate different numbers each time. The pseudo-random sequences will be +independent for all practical purposes, at least those purposes for which our +pseudo-randomness was good for in the first place. :: @@ -48,7 +49,14 @@ practically independent. >>> rng2.random() #doctest: +SKIP 0.11885628817151628 # may vary -Seeds are usually large positive integers. `default_rng` can take positive +.. warning:: + + The pseudo-random number generators implemented in this module are designed + for statistical modeling and simulation. They are not suitable for security + or cryptographic purposes. See the :py:module:`secrets` module from the + standard library such use cases. + +Seeds should be large positive integers. `default_rng` can take positive integers of any size. We recommend using very large, unique numbers to ensure that your seed is different from anyone else's. This is good practice to ensure that your results are statistically independent from theirs unless if you are |