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

Method test_weights

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

Source from the content-addressed store, hash-verified

707 assert_(H.shape == b)
708
709 def test_weights(self):
710 v = np.random.rand(100, 2)
711 hist, edges = histogramdd(v)
712 n_hist, edges = histogramdd(v, density=True)
713 w_hist, edges = histogramdd(v, weights=np.ones(100))
714 assert_array_equal(w_hist, hist)
715 w_hist, edges = histogramdd(v, weights=np.ones(100) * 2, density=True)
716 assert_array_equal(w_hist, n_hist)
717 w_hist, edges = histogramdd(v, weights=np.ones(100, int) * 2)
718 assert_array_equal(w_hist, 2 * hist)
719
720 def test_identical_samples(self):
721 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