Thursday, March 26, 2020

Normal/Gaussian in datascience in python

from scipy.stats import norm
import matplotlib.pyplot as plt
import numpy as np

x=np.arange(-3,3,0.001)
plt.plot(x,norm.pdf(x))

output:


import matplotlib.pyplot as plt
import numpy as np

mu= 5.0
sigma = 2.0

values = np.random.normal(mu,sigma,10000)
#10000 is data points
plt.hist(values,50)
#50 is number of bars

plt.show()

output:

No comments:

Post a Comment

python class topic video