MCPcopy
hub / github.com/numpy/numpy / test_equal_edges

Method test_equal_edges

numpy/lib/tests/test_histograms.py:784–796  ·  view source on GitHub ↗

Test that adjacent entries in an edge array can be equal

(self)

Source from the content-addressed store, hash-verified

782 range=[[0.0, 1.0], [np.nan, 0.75], [0.25, 0.5]])
783
784 def test_equal_edges(self):
785 """ Test that adjacent entries in an edge array can be equal """
786 x = np.array([0, 1, 2])
787 y = np.array([0, 1, 2])
788 x_edges = np.array([0, 2, 2])
789 y_edges = 1
790 hist, edges = histogramdd((x, y), bins=(x_edges, y_edges))
791
792 hist_expected = np.array([
793 [2.],
794 [1.], # x == 2 falls in the final bin
795 ])
796 assert_equal(hist, hist_expected)
797
798 def test_edge_dtype(self):
799 """ Test that if an edge array is input, its type is preserved """

Callers

nothing calls this directly

Calls 2

histogramddFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected