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

Method test_histogram_bin_edges

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

Source from the content-addressed store, hash-verified

385 self.do_precision(np.double, np.longdouble)
386
387 def test_histogram_bin_edges(self):
388 hist, e = histogram([1, 2, 3, 4], [1, 2])
389 edges = histogram_bin_edges([1, 2, 3, 4], [1, 2])
390 assert_array_equal(edges, e)
391
392 arr = np.array([0., 0., 0., 1., 2., 3., 3., 4., 5.])
393 hist, e = histogram(arr, bins=30, range=(-0.5, 5))
394 edges = histogram_bin_edges(arr, bins=30, range=(-0.5, 5))
395 assert_array_equal(edges, e)
396
397 hist, e = histogram(arr, bins='auto', range=(0, 1))
398 edges = histogram_bin_edges(arr, bins='auto', range=(0, 1))
399 assert_array_equal(edges, e)
400
401 def test_small_value_range(self):
402 arr = np.array([1, 1 + 2e-16] * 10)

Callers

nothing calls this directly

Calls 3

histogramFunction · 0.90
histogram_bin_edgesFunction · 0.90
assert_array_equalFunction · 0.90

Tested by

no test coverage detected