4 examples of 'numpy randint' in Python

Every line of 'numpy randint' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
171def rand_int(low, high):
172 return np.random.randint(low, high)
38def test_randomstate_randint_randomness(rnd):
39 a = rnd.randint(10000)
40 b = rnd.randint(10000)
41 assert a != b
208def _uniform(val_range):
209 """
210 Uniformly sample from the given range.
211
212 Args
213 val_range: A pair of lower and upper bound.
214 """
215 return np.random.uniform(val_range[0], val_range[1])
16def randint(a, b):
17 return a + int(random.random() * (b + 1 - a))

Related snippets