Skip to content

Instantly share code, notes, and snippets.

@rsnemmen
Created October 23, 2014 21:45
Generates random numbers following a normal distribution with arbitrary mean and standard deviation
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