summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorKatharine Hyatt <khyatt@flatironinstitute.org>2019-03-14 10:12:10 -0400
committerKatharine Hyatt <khyatt@flatironinstitute.org>2019-03-14 10:12:10 -0400
commitced4a500d81163afe1ae0c2aaa1ac5b776500e28 (patch)
tree8fe560b6bbe5f13125dd659f9f83957071542daa /numpy
parent9c3151f818a88ba260956220c5d4e9d0294f03cd (diff)
downloadnumpy-ced4a500d81163afe1ae0c2aaa1ac5b776500e28.tar.gz
Fix backticks, expand out docstring, improve consistency
Diffstat (limited to 'numpy')
-rw-r--r--numpy/random/mtrand/mtrand.pyx18
1 files changed, 10 insertions, 8 deletions
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx
index 4be77c49c..5d4dee8af 100644
--- a/numpy/random/mtrand/mtrand.pyx
+++ b/numpy/random/mtrand/mtrand.pyx
@@ -4203,9 +4203,9 @@ cdef class RandomState:
Draw samples from a Hypergeometric distribution.
Samples are drawn from a hypergeometric distribution with specified
- parameters, ``ngood`` (ways to make a good selection), ``nbad`` (ways to make
- a bad selection), and ``nsample`` = number of items sampled, which is less
- than or equal to the sum ``ngood + nbad``.
+ parameters, `ngood` (ways to make a good selection), `nbad` (ways to make
+ a bad selection), and `nsample` (number of items sampled, which is less
+ than or equal to the sum ``ngood + nbad``).
Parameters
----------
@@ -4219,14 +4219,16 @@ cdef class RandomState:
size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
``m * n * k`` samples are drawn. If size is ``None`` (default),
- a single value is returned if ``ngood``, ``nbad``, and ``nsample``
+ a single value is returned if `ngood`, `nbad`, and `nsample`
are all scalars. Otherwise, ``np.broadcast(ngood, nbad, nsample).size``
samples are drawn.
Returns
-------
out : ndarray or scalar
- Number of drawn good samples from the parameterized hypergeometric distribution.
+ Drawn samples from the parameterized hypergeometric distribution. Each
+ sample is the number of good items within a randomly selected subset of
+ size `nsample` taken from a set of `ngood` good items and `nbad` bad items.
See Also
--------
@@ -4242,10 +4244,10 @@ cdef class RandomState:
where :math:`0 \\le x \\le n` and :math:`n-b \\le x \\le g`
for P(x) the probability of ``x`` good results in the drawn sample,
- g = ``ngood``, b = ``nbad``, and n = ``nsample``.
+ g = `ngood`, b = `nbad`, and n = `nsample`.
- Consider an urn with black and white marbles in it, ``ngood`` of them
- are black and ``nbad`` are white. If you draw ``nsample`` balls without
+ Consider an urn with black and white marbles in it, `ngood` of them
+ are black and `nbad` are white. If you draw `nsample` balls without
replacement, then the hypergeometric distribution describes the
distribution of black balls in the drawn sample.