Skip to content

Instantly share code, notes, and snippets.

@Shaunakde
Last active January 15, 2016 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shaunakde/eed8ab49c94d30a80fc9 to your computer and use it in GitHub Desktop.
Save Shaunakde/eed8ab49c94d30a80fc9 to your computer and use it in GitHub Desktop.
Generate 1 million random numbers from the normal distribution with a set mu and sigma
from matplotlib import pyplot as plt
import random as r
sampleSize = 1000000 #1 million
mu = 1
sigma = 5
r.seed()
output = []
for i in range(sampleSize):
output.append(r.normalvariate(mu,sigma))
plt.hist(output,bins=100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment