Guest User

Untitled

a guest
Dec 10th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. # Simulate the values for 10000 random variables using .rvs.
  2. data= stats.norm.rvs(loc = 0, scale = 1, size =1000) # loc specifies the mean while scale the std
  3.  
  4. print("Mean: %g " %np.mean(data))
  5. print("SD: %g" %np.std(data, ddof=1))
  6.  
  7. plt.figure()
  8. plt.hist(data, bins = 20, color = '#F50057', normed = True, label = 'Gaussian(0,1)')
  9. plt.xlim(-5,5)
  10. pylab.legend(loc='upper right')
  11. plt.title("Gaussian Random Variables")
  12. plt.show()
Add Comment
Please, Sign In to add comment