MCPcopy
hub / github.com/numpy/numpy / test_n_zero

Method test_n_zero

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

assert_Function · 0.90
assert_array_equalFunction · 0.90

Tested by

no test coverage detected