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

Method test_random_sample

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

Source from the content-addressed store, hash-verified

551 np.iinfo('l').max, np.iinfo('l').max)
552
553 def test_random_sample(self):
554 random.seed(self.seed)
555 actual = random.random_sample((3, 2))
556 desired = np.array([[0.61879477158567997, 0.59162362775974664],
557 [0.88868358904449662, 0.89165480011560816],
558 [0.4575674820298663, 0.7781880808593471]])
559 assert_array_almost_equal(actual, desired, decimal=15)
560
561 random.seed(self.seed)
562 actual = random.random_sample()
563 assert_array_almost_equal(actual, desired[0, 0], decimal=15)
564
565 def test_choice_uniform_replace(self):
566 random.seed(self.seed)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected