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

Method test_weights

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

Source from the content-addressed store, hash-verified

668 assert_(H.shape == b)
669
670 def test_weights(self):
671 v = np.random.rand(100, 2)
672 hist, edges = histogramdd(v)
673 n_hist, edges = histogramdd(v, density=True)
674 w_hist, edges = histogramdd(v, weights=np.ones(100))
675 assert_array_equal(w_hist, hist)
676 w_hist, edges = histogramdd(v, weights=np.ones(100) * 2, density=True)
677 assert_array_equal(w_hist, n_hist)
678 w_hist, edges = histogramdd(v, weights=np.ones(100, int) * 2)
679 assert_array_equal(w_hist, 2 * hist)
680
681 def test_identical_samples(self):
682 x = np.zeros((10, 2), int)

Callers

nothing calls this directly

Calls 2

histogramddFunction · 0.90
assert_array_equalFunction · 0.90

Tested by

no test coverage detected