Here is a recipe to generate an array of random numbers following a normal distribution with the supplied mean and standard deviation in Python:
Update Oct. 23rd 2014: code snippet available on github.
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
Update Oct. 23rd 2014: code snippet available on github.
where did you get the nemmen package from though???
ReplyDeleteThere is no reference to this package above, but the nemmen package was renamed to nmmn and is available here: https://github.com/rsnemmen/nmmn
ReplyDelete