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

Method test_laplace

numpy/random/tests/test_generator_mt19937.py:1349–1355  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1347 assert_array_equal(actual, desired)
1348
1349 def test_laplace(self):
1350 random = Generator(MT19937(self.seed))
1351 actual = random.laplace(loc=.123456789, scale=2.0, size=(3, 2))
1352 desired = np.array([[-3.156353949272393, 1.195863024830054],
1353 [-3.435458081645966, 1.656882398925444],
1354 [ 0.924824032467446, 1.251116432209336]])
1355 assert_array_almost_equal(actual, desired, decimal=15)
1356
1357 def test_laplace_0(self):
1358 assert_equal(random.laplace(scale=0), 0)

Callers

nothing calls this directly

Calls 2

laplaceMethod · 0.80

Tested by

no test coverage detected