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

Method test_simple

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

Source from the content-addressed store, hash-verified

19 pass
20
21 def test_simple(self):
22 n = 100
23 v = np.random.rand(n)
24 (a, b) = histogram(v)
25 # check if the sum of the bins equals the number of samples
26 assert_equal(np.sum(a, axis=0), n)
27 # check that the bin counts are evenly spaced when the data is from
28 # a linear function
29 (a, b) = histogram(np.linspace(0, 10, 100))
30 assert_array_equal(a, 10)
31
32 def test_one_bin(self):
33 # Ticket 632

Callers

nothing calls this directly

Calls 5

histogramFunction · 0.90
assert_equalFunction · 0.90
assert_array_equalFunction · 0.90
linspaceMethod · 0.80
sumMethod · 0.45

Tested by

no test coverage detected