MCPcopy
hub / github.com/numpy/numpy / test_randn

Method test_randn

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

Source from the content-addressed store, hash-verified

473 assert_array_almost_equal(actual, desired, decimal=15)
474
475 def test_randn(self):
476 rng = random.RandomState(self.seed)
477 actual = rng.randn(3, 2)
478 desired = np.array([[1.34016345771863121, 1.73759122771936081],
479 [1.498988344300628, -0.2286433324536169],
480 [2.031033998682787, 2.17032494605655257]])
481 assert_array_almost_equal(actual, desired, decimal=15)
482
483 rng = random.RandomState(self.seed)
484 actual = rng.randn()
485 assert_array_almost_equal(actual, desired[0, 0], decimal=15)
486
487 def test_randint(self):
488 rng = random.RandomState(self.seed)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected