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

Method test_density

numpy/lib/tests/test_twodim_base.py:245–253  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

243 assert_array_equal(yed, np.linspace(0, 5, 6))
244
245 def test_density(self):
246 x = array([1, 2, 3, 1, 2, 3, 1, 2, 3])
247 y = array([1, 1, 1, 2, 2, 2, 3, 3, 3])
248 H, xed, yed = histogram2d(
249 x, y, [[1, 2, 3, 5], [1, 2, 3, 5]], density=True)
250 answer = array([[1, 1, .5],
251 [1, 1, .5],
252 [.5, .5, .25]]) / 9.
253 assert_array_almost_equal(H, answer, 3)
254
255 def test_all_outliers(self):
256 r = np.random.rand(100) + 1. + 1e6 # histogramdd rounds by decimal=6

Callers

nothing calls this directly

Calls 3

arrayFunction · 0.90
histogram2dFunction · 0.90

Tested by

no test coverage detected