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

Method test_laplace

numpy/random/tests/test_randomstate.py:916–922  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

914 assert_array_equal(actual, desired)
915
916 def test_laplace(self):
917 random.seed(self.seed)
918 actual = random.laplace(loc=.123456789, scale=2.0, size=(3, 2))
919 desired = np.array([[0.66599721112760157, 0.52829452552221945],
920 [3.12791959514407125, 3.18202813572992005],
921 [-0.05391065675859356, 1.74901336242837324]])
922 assert_array_almost_equal(actual, desired, decimal=15)
923
924 def test_laplace_0(self):
925 assert_equal(random.laplace(scale=0), 0)

Callers

nothing calls this directly

Calls 2

laplaceMethod · 0.80

Tested by

no test coverage detected