Created
October 23, 2014 21:45
-
-
Save rsnemmen/d022dbbdea670481f472 to your computer and use it in GitHub Desktop.
Generates random numbers following a normal distribution with arbitrary mean and standard deviation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def random_normal(mean,std,n): | |
""" | |
Returns an array of n elements of random variables, following a normal | |
distribution with the supplied mean and standard deviation. | |
""" | |
import scipy | |
return std*scipy.random.standard_normal(n)+mean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment