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

Method test_random_sample

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

Source from the content-addressed store, hash-verified

558 np.iinfo('l').max, np.iinfo('l').max)
559
560 def test_random_sample(self):
561 rng = random.RandomState(self.seed)
562 actual = rng.random_sample((3, 2))
563 desired = np.array([[0.61879477158567997, 0.59162362775974664],
564 [0.88868358904449662, 0.89165480011560816],
565 [0.4575674820298663, 0.7781880808593471]])
566 assert_array_almost_equal(actual, desired, decimal=15)
567
568 rng = random.RandomState(self.seed)
569 actual = rng.random_sample()
570 assert_array_almost_equal(actual, desired[0, 0], decimal=15)
571
572 def test_choice_uniform_replace(self):
573 rng = random.RandomState(self.seed)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected