diff options
author | Warren Weckesser <warren.weckesser@gmail.com> | 2020-04-05 23:25:53 -0400 |
---|---|---|
committer | Warren Weckesser <warren.weckesser@gmail.com> | 2020-04-05 23:35:50 -0400 |
commit | f90f26c40ac4b37e1df8c76ee6745433557d999b (patch) | |
tree | 57af5f657f9769fdab28eb1dd45dd621c14fa7fe /numpy/lib/nanfunctions.py | |
parent | 0f6a3aaa34fe72586f8c66ecc4744fc960d62ae2 (diff) | |
download | numpy-f90f26c40ac4b37e1df8c76ee6745433557d999b.tar.gz |
BUG: random: Disallow p=0 in negative_binomial
Make `Generator.negative_binomial` raise a ValueError if p=0.
`negative_binomial(n, p)` draws samples from the distribution of
the number of failures until n successes are encountered. If p is 0,
then a success is never encountered, so the probability distribution
is 0 for any finite number of failures. In other words, it is not
really a meaningful distribution, so we disallow p=0.
Closes gh-15913.
Diffstat (limited to 'numpy/lib/nanfunctions.py')
0 files changed, 0 insertions, 0 deletions