summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2022-07-10 11:21:58 -0600
committerGitHub <noreply@github.com>2022-07-10 11:21:58 -0600
commitc1fce11d73a56b1bf348b2f652fd6a110dde4100 (patch)
treec603093b011d5120e5f6bfb26b7b5ca3ef8269a9 /numpy
parent8b8ca096728916c5f07f8d7ce2de6df1816873a9 (diff)
parent5111b1ee832f861a44a7afb1cf19e10fffe5ce4a (diff)
downloadnumpy-c1fce11d73a56b1bf348b2f652fd6a110dde4100.tar.gz
Merge pull request #21856 from bramton/main
DOC: Mention uniform in the np.random.Generator.random function.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/random/_generator.pyx10
1 files changed, 7 insertions, 3 deletions
diff --git a/numpy/random/_generator.pyx b/numpy/random/_generator.pyx
index 5153c3827..77f70e9fe 100644
--- a/numpy/random/_generator.pyx
+++ b/numpy/random/_generator.pyx
@@ -242,10 +242,10 @@ cdef class Generator:
Return random floats in the half-open interval [0.0, 1.0).
Results are from the "continuous uniform" distribution over the
- stated interval. To sample :math:`Unif[a, b), b > a` multiply
- the output of `random` by `(b-a)` and add `a`::
+ stated interval. To sample :math:`Unif[a, b), b > a` use `uniform`
+ or multiply the output of `random` by ``(b - a)`` and add ``a``::
- (b - a) * random() + a
+ (b - a) * random() + a
Parameters
----------
@@ -267,6 +267,10 @@ cdef class Generator:
Array of random floats of shape `size` (unless ``size=None``, in which
case a single float is returned).
+ See Also
+ --------
+ uniform : Draw samples from the parameterized uniform distribution.
+
Examples
--------
>>> rng = np.random.default_rng()