summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrigitta Sipőcz <bsipocz@gmail.com>2022-09-16 21:42:43 -0700
committerBrigitta Sipőcz <bsipocz@gmail.com>2022-09-16 22:13:16 -0700
commit368d47f9a3279f83ca2ed0c21a5fc3409425797e (patch)
treedfbde6ce7ec6b7be6af2852a2d75eda29353e682
parent839ec3885b8e36cee1136b948fc92b06c1f544f9 (diff)
downloadnumpy-368d47f9a3279f83ca2ed0c21a5fc3409425797e.tar.gz
DOC: Update notes with API link
-rw-r--r--numpy/random/mtrand.pyx222
1 files changed, 138 insertions, 84 deletions
diff --git a/numpy/random/mtrand.pyx b/numpy/random/mtrand.pyx
index 446ddc84d..42738aa6d 100644
--- a/numpy/random/mtrand.pyx
+++ b/numpy/random/mtrand.pyx
@@ -394,8 +394,9 @@ cdef class RandomState:
(b - a) * random_sample() + a
.. note::
- New code should use the ``random`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.random`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -464,8 +465,10 @@ cdef class RandomState:
It is often seen in Bayesian inference and order statistics.
.. note::
- New code should use the ``beta`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.beta`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
+
Parameters
----------
@@ -514,8 +517,9 @@ cdef class RandomState:
between page requests to Wikipedia [2]_.
.. note::
- New code should use the ``exponential`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.exponential`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -563,8 +567,10 @@ cdef class RandomState:
with a scale parameter of 1.
.. note::
- New code should use the ``standard_exponential`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.standard_exponential`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -664,8 +670,9 @@ cdef class RandomState:
`high` is None (the default), then results are from [0, `low`).
.. note::
- New code should use the ``integers`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.randint`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -785,8 +792,9 @@ cdef class RandomState:
Return random bytes.
.. note::
- New code should use the ``bytes`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.bytes`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -823,8 +831,9 @@ cdef class RandomState:
.. versionadded:: 1.7.0
.. note::
- New code should use the ``choice`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.choice`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -1033,8 +1042,9 @@ cdef class RandomState:
by `uniform`.
.. note::
- New code should use the ``uniform`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.uniform`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -1204,8 +1214,10 @@ cdef class RandomState:
other NumPy functions like `numpy.zeros` and `numpy.ones`.
.. note::
- New code should use the ``standard_normal`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.standard_normal`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
If positive int_like arguments are provided, `randn` generates an array
of shape ``(d0, d1, ..., dn)``, filled
@@ -1360,8 +1372,10 @@ cdef class RandomState:
Draw samples from a standard Normal distribution (mean=0, stdev=1).
.. note::
- New code should use the ``standard_normal`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.standard_normal`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -1437,8 +1451,9 @@ cdef class RandomState:
unique distribution [2]_.
.. note::
- New code should use the ``normal`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.normal`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -1538,8 +1553,10 @@ cdef class RandomState:
shape (sometimes designated "k") and scale=1.
.. note::
- New code should use the ``standard_gamma`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.standard_gamma`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -1619,8 +1636,9 @@ cdef class RandomState:
"theta"), where both parameters are > 0.
.. note::
- New code should use the ``gamma`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.gamma`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -1708,8 +1726,9 @@ cdef class RandomState:
variates.
.. note::
- New code should use the ``f`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.f`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -1796,8 +1815,10 @@ cdef class RandomState:
`nonc` is the non-centrality parameter.
.. note::
- New code should use the ``noncentral_f`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.noncentral_f`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -1881,8 +1902,9 @@ cdef class RandomState:
is often used in hypothesis testing.
.. note::
- New code should use the ``chisquare`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.chisquare`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -1954,8 +1976,10 @@ cdef class RandomState:
the :math:`\\chi^2` distribution.
.. note::
- New code should use the ``noncentral_chisquare`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.noncentral_chisquare`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -2040,8 +2064,10 @@ cdef class RandomState:
Also known as the Lorentz distribution.
.. note::
- New code should use the ``standard_cauchy`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.standard_cauchy`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -2116,8 +2142,9 @@ cdef class RandomState:
distribution (`standard_normal`).
.. note::
- New code should use the ``standard_t`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.standard_t`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -2233,8 +2260,9 @@ cdef class RandomState:
distribution.
.. note::
- New code should use the ``vonmises`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.vonmises`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -2331,8 +2359,9 @@ cdef class RandomState:
remaining 80 percent of the range.
.. note::
- New code should use the ``pareto`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.pareto`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -2425,8 +2454,9 @@ cdef class RandomState:
:math:`\\lambda` is just :math:`X = \\lambda(-ln(U))^{1/a}`.
.. note::
- New code should use the ``weibull`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.weibull`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -2521,8 +2551,9 @@ cdef class RandomState:
Also known as the power function distribution.
.. note::
- New code should use the ``power`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.power`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -2632,8 +2663,9 @@ cdef class RandomState:
random variables.
.. note::
- New code should use the ``laplace`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.laplace`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -2723,8 +2755,9 @@ cdef class RandomState:
Notes and References below.
.. note::
- New code should use the ``gumbel`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.gumbel`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -2845,8 +2878,9 @@ cdef class RandomState:
parameters, loc (location or mean, also median), and scale (>0).
.. note::
- New code should use the ``logistic`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.logistic`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -2932,8 +2966,9 @@ cdef class RandomState:
underlying normal distribution it is derived from.
.. note::
- New code should use the ``lognormal`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.lognormal`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -3045,8 +3080,9 @@ cdef class RandomState:
Rayleigh.
.. note::
- New code should use the ``rayleigh`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.rayleigh`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -3127,8 +3163,9 @@ cdef class RandomState:
unit distance and distance covered in unit time.
.. note::
- New code should use the ``wald`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.wald`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -3200,8 +3237,9 @@ cdef class RandomState:
directly define the shape of the pdf.
.. note::
- New code should use the ``triangular`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.triangular`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -3307,8 +3345,9 @@ cdef class RandomState:
input as a float, but it is truncated to an integer in use)
.. note::
- New code should use the ``binomial`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.binomial`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -3457,8 +3496,10 @@ cdef class RandomState:
is > 0 and `p` is in the interval [0, 1].
.. note::
- New code should use the ``negative_binomial`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.negative_binomial`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -3542,8 +3583,9 @@ cdef class RandomState:
for large N.
.. note::
- New code should use the ``poisson`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.poisson`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -3629,8 +3671,9 @@ cdef class RandomState:
frequency table.
.. note::
- New code should use the ``zipf`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.zipf`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -3728,8 +3771,9 @@ cdef class RandomState:
where `p` is the probability of success of an individual trial.
.. note::
- New code should use the ``geometric`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.geometric`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -3782,8 +3826,10 @@ cdef class RandomState:
than or equal to the sum ``ngood + nbad``).
.. note::
- New code should use the ``hypergeometric`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.hypergeometric`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -3913,8 +3959,9 @@ cdef class RandomState:
shape parameter, 0 < ``p`` < 1.
.. note::
- New code should use the ``logseries`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.logseries`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -4006,8 +4053,10 @@ cdef class RandomState:
squared) of the one-dimensional normal distribution.
.. note::
- New code should use the ``multivariate_normal`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.multivariate_normal`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -4203,8 +4252,9 @@ cdef class RandomState:
outcome was ``i``.
.. note::
- New code should use the ``multinomial`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.multinomial`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -4337,8 +4387,9 @@ cdef class RandomState:
inference.
.. note::
- New code should use the ``dirichlet`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.dirichlet`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -4483,8 +4534,9 @@ cdef class RandomState:
their contents remains the same.
.. note::
- New code should use the ``shuffle`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the `~numpy.random.Generator.shuffle`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------
@@ -4606,8 +4658,10 @@ cdef class RandomState:
first index.
.. note::
- New code should use the ``permutation`` method of a ``Generator``
- instance instead; please see the :ref:`random-quick-start`.
+ New code should use the
+ `~numpy.random.Generator.permutation`
+ method of a `~numpy.random.Generator` instance instead;
+ please see the :ref:`random-quick-start`.
Parameters
----------