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

Method test_laplace

numpy/random/tests/test_random.py:716–722  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

714 assert_array_equal(actual, desired)
715
716 def test_laplace(self):
717 np.random.seed(self.seed)
718 actual = np.random.laplace(loc=.123456789, scale=2.0, size=(3, 2))
719 desired = np.array([[0.66599721112760157, 0.52829452552221945],
720 [3.12791959514407125, 3.18202813572992005],
721 [-0.05391065675859356, 1.74901336242837324]])
722 assert_array_almost_equal(actual, desired, decimal=15)
723
724 def test_laplace_0(self):
725 assert_equal(np.random.laplace(scale=0), 0)

Callers

nothing calls this directly

Calls 2

laplaceMethod · 0.80

Tested by

no test coverage detected