Chapter 3
Chapter 3
distribution
I N T R O D U C T I O N T O S TAT I S T I C S I N P Y T H O N
Maggie Matsui
Content Developer, DataCamp
What is the normal distribution?
Mean: 20
Standard deviation:
3
Standard normal
distribution
Mean: 0
Standard deviation:
1
Mean: 20
Standard deviation:
3
Standard normal
distribution
Mean: 0
Standard deviation:
1
0.158655
0.841345
0.1252
169.97086
152.029
Maggie Matsui
Content Developer, DataCamp
Rolling the dice 5 times
die = pd.Series([1, 2, 3, 4, 5, 6])
# Roll 5 times
samp_5 = die.sample(5, replace=True)
print(samp_5)
array([3, 1, 4, 1, 1])
np.mean(samp_5)
2.0
4.4
3.8
sales_team.sample(10, replace=True)
3.48
Maggie Matsui
Content Developer, DataCamp
Poisson processes
Events appear to happen at a certain rate,
but completely at random
Examples
Number of animals adopted from an
animal shelter per week
Examples
Probability of ≥ 5 animals adopted from an animal shelter per week
0.09160366
0.1912361
1 - poisson.cdf(5, 8)
0.8087639
If the average number of adoptions per week is 10, what is P (# adoptions in a week > 5)?
1 - poisson.cdf(5, 10)
0.932914
Maggie Matsui
Content Developer, DataCamp
Exponential distribution
Probability of time between Poisson events
Examples
Probability of > 1 day between adoptions
Continuous (time)
0.8646647167633873
0.0024787521766663767 0.13285653105994633
Examples:
Length of chess games