3 examples of 'python numpy random float' in Python

Every line of 'python numpy random float' 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
this disclaimer
266def rand_float(low, high):
267 """
268 Generate random floating point number between two limits
269
270 Args:
271 low: low limit
272 high: high limit
273
274 Returns:
275 single random floating point number
276 """
277 return (high - low) * np.random.random_sample() + low
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

23def rand_scalar():
24 return float(np.random.randn())
509def randn(n, seed=12345):
510 res = np.empty(n, dtype='float32')
511 float_randn(swig_ptr(res), n, seed)
512 return res

Related snippets