Python Forum
How to graph a normal distribution?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to graph a normal distribution?
#1
Hello, if I have a problem in the following way:

x: 20
mu: 17
sigma: 1.1
well before graphing you need to get the Z-score, so I apply the following:

z = (x - mu)/sigma
Now I can just use z in a normal distribution, but here my big problem, as I generate values for the graph.

import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import math

mu = 8
sigma = 2
# here x must be z
x = np.linspace(mu - 3*sigma, mu + 3*sigma, 10)
#----------------------------
print(np.linspace(mu - 3*sigma, mu + 3*sigma, 10))
plt.plot(x, stats.norm.pdf(x, mu, sigma))
plt.show()
good in this code x is generated but my doubt is that it replaced x by z and that at the same time I must generate the graph of said variable Exclamation
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Why does a Numpy with Intel MKL have the same performance as a normal one? AlekseyPython 0 1,870 Nov-12-2020, 06:36 AM
Last Post: AlekseyPython
  unsupervised learning for distribution of outliers dervast 3 2,696 Aug-01-2019, 12:41 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020