Last active
January 15, 2016 05:27
-
-
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
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
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