MCPcopy Index your code
hub / github.com/numpy/numpy / test_one_bin

Method test_one_bin

numpy/lib/tests/test_histograms.py:39–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37 assert_array_equal(a, 10)
38
39 def test_one_bin(self):
40 # Ticket 632
41 hist, edges = histogram([1, 2, 3, 4], [1, 2])
42 assert_array_equal(hist, [2, ])
43 assert_array_equal(edges, [1, 2])
44 assert_raises(ValueError, histogram, [1, 2], bins=0)
45 h, e = histogram([1, 2], bins=1)
46 assert_equal(h, np.array([2]))
47 assert_allclose(e, np.array([1., 2.]))
48
49 def test_density(self):
50 # Check that the integral of the density equals 1.

Callers

nothing calls this directly

Calls 5

histogramFunction · 0.90
assert_array_equalFunction · 0.90
assert_raisesFunction · 0.90
assert_equalFunction · 0.90
assert_allcloseFunction · 0.90

Tested by

no test coverage detected