BaşlayınÜcretsiz Başlayın

Generating and plotting Poisson distributions

In the previous exercise, you calculated some probabilities. Now let's plot that distribution.

Recall that on a certain highway turn, there are 2 accidents per day on average. Assuming the number of accidents per day can be modeled as a Poisson random variable, let's plot the distribution.

Bu egzersiz

Foundations of Probability in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import poisson from scipy.stats, matplotlib.pyplot as plt, and seaborn as sns.
  • Generate a Poisson distribution sample with size=10000 and mu=2.
  • Plot the sample generated.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import poisson, matplotlib.pyplot, and seaborn
from ____ import ____
import ____ as ____ 
import ____ as ____

# Create the sample
sample = poisson.___(mu=____, size=10000, random_state=13)

# Plot the sample
sns.distplot(____, kde=False)
plt.show()
Kodu Düzenle ve Çalıştır