0
0
SciPydata~10 mins

Poisson distribution in SciPy - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the Poisson distribution from scipy.stats.

SciPy
from scipy.stats import [1]
Drag options to blanks, or click blank then click option'
Apoisson
Bbinom
Cnorm
Duniform
Attempts:
3 left
💡 Hint
Common Mistakes
Importing the normal distribution instead of Poisson.
Using a distribution for continuous data instead of discrete.
2fill in blank
medium

Complete the code to calculate the probability of exactly 3 events when the average rate is 2.

SciPy
prob = poisson.pmf([1], mu=2)
Drag options to blanks, or click blank then click option'
A2
B1
C0
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using the mean value instead of the event count as the first argument.
Confusing pmf with cdf.
3fill in blank
hard

Fix the error in the code to calculate the cumulative probability of up to 4 events with mean 3.

SciPy
cum_prob = poisson.[1](4, mu=3)
Drag options to blanks, or click blank then click option'
Apmf
Bcdf
Cpdf
Dsf
Attempts:
3 left
💡 Hint
Common Mistakes
Using pmf which gives probability of exactly k events.
Using sf which gives the survival function (1 - cdf).
4fill in blank
hard

Fill both blanks to create a dictionary of probabilities for 0 to 5 events with mean 2.

SciPy
prob_dict = {k: poisson.[1](k, mu=[2]) for k in range(6)}
Drag options to blanks, or click blank then click option'
Apmf
Bcdf
C2
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using cdf instead of pmf for exact probabilities.
Using wrong mean value.
5fill in blank
hard

Fill all three blanks to filter events with probability greater than 0.1 from a dictionary.

SciPy
filtered = {k: v for k, v in prob_dict.items() if v [1] [2]
threshold = [3]
Drag options to blanks, or click blank then click option'
A>
B0.1
C<
D0.05
Attempts:
3 left
💡 Hint
Common Mistakes
Using less than instead of greater than.
Using wrong threshold value.