MCPcopy Create free account
hub / github.com/numpy/numpy / test_n_zero

Method test_n_zero

numpy/random/tests/test_randomstate.py:120–127  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

118
119class TestBinomial:
120 def test_n_zero(self):
121 # Tests the corner case of n == 0 for the binomial distribution.
122 # binomial(0, p) should be zero for any p in [0, 1].
123 # This test addresses issue #3480.
124 zeros = np.zeros(2, dtype='int')
125 for p in [0, .5, 1]:
126 assert_(random.binomial(0, p) == 0)
127 assert_array_equal(random.binomial(zeros, p), zeros)
128
129 def test_p_is_nan(self):
130 # Issue #4571.

Callers

nothing calls this directly

Calls 2

assert_Function · 0.90
assert_array_equalFunction · 0.90

Tested by

no test coverage detected