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

Method test_random

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

Source from the content-addressed store, hash-verified

774 assert_equal(actual, desired)
775
776 def test_random(self):
777 random = Generator(MT19937(self.seed))
778 actual = random.random((3, 2))
779 desired = np.array([[0.096999199829214, 0.707517457682192],
780 [0.084364834598269, 0.767731206553125],
781 [0.665069021359413, 0.715487190596693]])
782 assert_array_almost_equal(actual, desired, decimal=15)
783
784 random = Generator(MT19937(self.seed))
785 actual = random.random()
786 assert_array_almost_equal(actual, desired[0, 0], decimal=15)
787
788 def test_random_float(self):
789 random = Generator(MT19937(self.seed))

Callers

nothing calls this directly

Calls 2

randomMethod · 0.80

Tested by

no test coverage detected