Skip to content

Instantly share code, notes, and snippets.

@tshev
Created May 29, 2014 19:28
Show Gist options
  • Save tshev/bbeb418f1f63d888fa9e to your computer and use it in GitHub Desktop.
Save tshev/bbeb418f1f63d888fa9e to your computer and use it in GitHub Desktop.
Normal distribution. Python
%pylab inline
import matplotlib.pyplot as plt
import scipy
import scipy.stats
g = scipy.stats.norm(-3.5,0.05)
r = g.rvs(100)
r.sort()
print g.median()
plt.plot(r, np.array([g.pdf(i) for i in r]))
plt.show()
plt.hist(r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment