summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-02-18 19:54:18 +0200
committerGitHub <noreply@github.com>2019-02-18 19:54:18 +0200
commit5d122da3fb61eb09662e51f016f59250ee39b30c (patch)
tree2f7bc6c436408586f2ef69f0488df688b97017b7
parent8063fa6d1b92a755db9727b17428eb19e0ba590f (diff)
parent61b3fa03b3bd4d05892646e13de35f00f577d786 (diff)
downloadnumpy-5d122da3fb61eb09662e51f016f59250ee39b30c.tar.gz
Merge pull request #12983 from bashtage/randomstate-docstring-fixes
DOC: Randomstate docstring fixes
-rw-r--r--numpy/random/mtrand/mtrand.pyx15
-rw-r--r--numpy/random/tests/test_random.py2
2 files changed, 5 insertions, 12 deletions
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx
index c83046e2e..5f1039cb2 100644
--- a/numpy/random/mtrand/mtrand.pyx
+++ b/numpy/random/mtrand/mtrand.pyx
@@ -2328,17 +2328,9 @@ cdef class RandomState:
where :math:`Y_{q}` is the Chi-square with q degrees of freedom.
- In Delhi (2007), it is noted that the noncentral chi-square is
- useful in bombing and coverage problems, the probability of
- killing the point target given by the noncentral chi-squared
- distribution.
-
References
----------
- .. [1] Delhi, M.S. Holla, "On a noncentral chi-square distribution in
- the analysis of weapon systems effectiveness", Metrika,
- Volume 15, Number 1 / December, 1970.
- .. [2] Wikipedia, "Noncentral chi-squared distribution"
+ .. [1] Wikipedia, "Noncentral chi-squared distribution"
https://en.wikipedia.org/wiki/Noncentral_chi-squared_distribution
Examples
@@ -2368,7 +2360,6 @@ cdef class RandomState:
>>> values = plt.hist(np.random.noncentral_chisquare(3, 20, 100000),
... bins=200, density=True)
>>> plt.show()
-
"""
cdef ndarray odf, ononc
cdef double fdf, fnonc
@@ -3539,9 +3530,9 @@ cdef class RandomState:
Parameters
----------
mean : float or array_like of floats
- Distribution mean, should be > 0.
+ Distribution mean, must be > 0.
scale : float or array_like of floats
- Scale parameter, should be >= 0.
+ Scale parameter, must be > 0.
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),
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index d4721bc62..656e38dc8 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -1354,6 +1354,8 @@ class TestBroadcast(object):
assert_array_almost_equal(actual, desired, decimal=14)
assert_raises(ValueError, wald, bad_mean, scale * 3)
assert_raises(ValueError, wald, mean, bad_scale * 3)
+ assert_raises(ValueError, wald, 0.0, 1)
+ assert_raises(ValueError, wald, 0.5, 0.0)
def test_triangular(self):
left = [1]