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

Method test_one_bin

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

Source from the content-addressed store, hash-verified

30 assert_array_equal(a, 10)
31
32 def test_one_bin(self):
33 # Ticket 632
34 hist, edges = histogram([1, 2, 3, 4], [1, 2])
35 assert_array_equal(hist, [2, ])
36 assert_array_equal(edges, [1, 2])
37 assert_raises(ValueError, histogram, [1, 2], bins=0)
38 h, e = histogram([1, 2], bins=1)
39 assert_equal(h, np.array([2]))
40 assert_allclose(e, np.array([1., 2.]))
41
42 def test_density(self):
43 # 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