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

Method test_simple

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

Source from the content-addressed store, hash-verified

26 pass
27
28 def test_simple(self):
29 n = 100
30 v = np.random.rand(n)
31 (a, b) = histogram(v)
32 # check if the sum of the bins equals the number of samples
33 assert_equal(np.sum(a, axis=0), n)
34 # check that the bin counts are evenly spaced when the data is from
35 # a linear function
36 (a, b) = histogram(np.linspace(0, 10, 100))
37 assert_array_equal(a, 10)
38
39 def test_one_bin(self):
40 # 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