Introduction aux statistiques en Python
Maggie Matsui
Content Developer, DataCamp
Moyenne = 20
Écart-type = 3
Distribution normale standard
Moyenne = 0
Écart-type = 1
Moyenne = 20
Écart-type = 3
Distribution normale standard
Moyenne = 0
Écart-type = 1
Moyenne = 161 cm Écart-type = 7 cm
16 % des femmes interrogées mesurent moins de 154 cm
from scipy.stats import norm
norm.cdf(154, 161, 7)
0.158655
from scipy.stats import norm
1 - norm.cdf(154, 161, 7)
0.841345
norm.cdf(157, 161, 7) - norm.cdf(154, 161, 7)
norm.cdf(157, 161, 7) - norm.cdf(154, 161, 7)
0.1252
norm.ppf(0.9, 161, 7)
169.97086
norm.ppf((1-0.9), 161, 7)
152.029
# Generate 10 random heights
norm.rvs(161, 7, size=10)
array([155.5758223 , 155.13133235, 160.06377097, 168.33345778,
165.92273375, 163.32677057, 165.13280753, 146.36133538,
149.07845021, 160.5790856 ])
Introduction aux statistiques en Python