Random numbers generators with “numpy”

Random numbers generators with “numpy”#

https://numpy.org/doc/stable/reference/random/generator.html#

import numpy as np
# uniform distribution from 1 to 10
print(np.random.uniform(0,1))
0.6413513121893517
# gaussian 
print(np.random.normal(0,1))
1.6144760660733362
# array of gaussian random numbers
np.random.normal(0,1,10)
array([-0.66232317,  0.03080433,  0.97750313,  0.08874166, -0.41567199,
       -1.6377285 , -1.96048802, -0.62995365,  0.01624923, -0.42524478])