Published
- 1 min read
plot normal distribution python
The solution for this is noted below
plot normal distribution python
Solution
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import math
mu = 0
variance = 1
sigma = math.sqrt(variance)
x = np.linspace(mu - 3 * sigma, mu + 3 * sigma, 100)
plt.plot(x, stats.norm.pdf(x, mu, sigma))
plt.show()
Try other methods by searching on the site. That is if this doesn’t work