summaryrefslogtreecommitdiff
path: root/doc/source/reference/random/legacy.rst
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2019-04-14 12:51:47 +0300
committermattip <matti.picus@gmail.com>2019-05-20 18:45:27 +0300
commitb9b9d70f096875b0afe3b634982ad22bb6c2c815 (patch)
treeadd395910edd44cd6c9ca0f0ebfd17f86c64be68 /doc/source/reference/random/legacy.rst
parentedfd3134cda92384aa35f08209bc22d0fae80143 (diff)
downloadnumpy-b9b9d70f096875b0afe3b634982ad22bb6c2c815.tar.gz
MAINT: remove legacy, refactor legacy -> mtrand in docs
Diffstat (limited to 'doc/source/reference/random/legacy.rst')
-rw-r--r--doc/source/reference/random/legacy.rst104
1 files changed, 59 insertions, 45 deletions
diff --git a/doc/source/reference/random/legacy.rst b/doc/source/reference/random/legacy.rst
index b9bfabcc7..23ab1ad8e 100644
--- a/doc/source/reference/random/legacy.rst
+++ b/doc/source/reference/random/legacy.rst
@@ -1,16 +1,16 @@
Legacy Random Generation
------------------------
-The :class:`~legacy.LegacyGenerator` provides access to
+The :class:`~mtrand.RandomState` provides access to
legacy generators. These all depend on Box-Muller normals or
-inverse CDF exponentials or gammas. This class should only be used
+inverse CDF exponentials or gammas. This class should only be used
if it is essential to have randoms that are identical to what
-would have been produced by NumPy.
+would have been produced by NumPy.
-:class:`~legacy.LegacyGenerator` add additional information
+:class:`~mtrand.RandomState` adds additional information
to the state which is required when using Box-Muller normals since these
-are produced in pairs. It is important to use
-:attr:`~legacy.LegacyGenerator.state`
-when accessing the state so that these extra values are saved.
+are produced in pairs. It is important to use
+:attr:`~mtrand.RandomState.get_state`
+when accessing the state so that these extra values are saved.
.. warning::
@@ -26,9 +26,9 @@ when accessing the state so that these extra values are saved.
.. code-block:: python
-
+
from numpy.random import MT19937
- from numpy.random.legacy import LegacyGenerator
+ from numpy.random._mtrand import RandomState as LegacyGenerator
from numpy.random import RandomState
# Use same seed
rs = RandomState(12345)
@@ -45,11 +45,11 @@ when accessing the state so that these extra values are saved.
rs.standard_exponential()
lg.standard_exponential()
-
-.. currentmodule:: numpy.random.legacy
-.. autoclass:: LegacyGenerator
+.. currentmodule:: numpy.random.mtrand
+
+.. autoclass:: RandomState
:exclude-members:
Seeding and State
@@ -58,53 +58,67 @@ Seeding and State
.. autosummary::
:toctree: generated/
- ~LegacyGenerator.get_state
- ~LegacyGenerator.set_state
-
+ ~RandomState.get_state
+ ~RandomState.set_state
+
Simple random data
==================
.. autosummary::
:toctree: generated/
- ~LegacyGenerator.randn
- ~LegacyGenerator.randint
- ~LegacyGenerator.random_integers
- ~LegacyGenerator.random_sample
- ~LegacyGenerator.choice
- ~LegacyGenerator.bytes
+ ~RandomState.rand
+ ~RandomState.randn
+ ~RandomState.randint
+ ~RandomState.random_integers
+ ~RandomState.random_sample
+ ~RandomState.choice
+ ~RandomState.bytes
Permutations
============
.. autosummary::
:toctree: generated/
- ~LegacyGenerator.shuffle
- ~LegacyGenerator.permutation
+ ~RandomState.shuffle
+ ~RandomState.permutation
Distributions
=============
.. autosummary::
:toctree: generated/
- ~LegacyGenerator.beta
- ~LegacyGenerator.chisquare
- ~LegacyGenerator.dirichlet
- ~LegacyGenerator.exponential
- ~LegacyGenerator.f
- ~LegacyGenerator.gamma
- ~LegacyGenerator.lognormal
- ~LegacyGenerator.multivariate_normal
- ~LegacyGenerator.negative_binomial
- ~LegacyGenerator.noncentral_chisquare
- ~LegacyGenerator.noncentral_f
- ~LegacyGenerator.normal
- ~LegacyGenerator.pareto
- ~LegacyGenerator.power
- ~LegacyGenerator.standard_cauchy
- ~LegacyGenerator.standard_exponential
- ~LegacyGenerator.standard_gamma
- ~LegacyGenerator.standard_normal
- ~LegacyGenerator.standard_t
- ~LegacyGenerator.wald
- ~LegacyGenerator.weibull
- ~LegacyGenerator.zipf
+ ~RandomState.beta
+ ~RandomState.binomial
+ ~RandomState.chisquare
+ ~RandomState.dirichlet
+ ~RandomState.exponential
+ ~RandomState.f
+ ~RandomState.gamma
+ ~RandomState.geometric
+ ~RandomState.gumbel
+ ~RandomState.hypergeometric
+ ~RandomState.laplace
+ ~RandomState.logistic
+ ~RandomState.lognormal
+ ~RandomState.logseries
+ ~RandomState.multinomial
+ ~RandomState.multivariate_normal
+ ~RandomState.negative_binomial
+ ~RandomState.noncentral_chisquare
+ ~RandomState.noncentral_f
+ ~RandomState.normal
+ ~RandomState.pareto
+ ~RandomState.poisson
+ ~RandomState.power
+ ~RandomState.rayleigh
+ ~RandomState.standard_cauchy
+ ~RandomState.standard_exponential
+ ~RandomState.standard_gamma
+ ~RandomState.standard_normal
+ ~RandomState.standard_t
+ ~RandomState.triangular
+ ~RandomState.uniform
+ ~RandomState.vonmises
+ ~RandomState.wald
+ ~RandomState.weibull
+ ~RandomState.zipf