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

Plotting normal distributions

A certain restaurant chain has been collecting data about customer spending. The data shows that the spending is approximately normally distributed, with a mean of $3.15 and a standard deviation of $1.50 per customer.

Bu egzersiz

Foundations of Probability in Python

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

Egzersiz talimatları

  • Import norm from scipy.stats, matplotlib.pyplot as plt, and seaborn as sns.
  • Generate a normal distribution sample with mean 3.15 and standard deviation 1.5.
  • Plot the sample generated.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import norm, matplotlib.pyplot, and seaborn
from scipy.stats import ____
import matplotlib.pyplot as ____
import seaborn as ____

# Create the sample using norm.rvs()
sample = norm.____(loc=____, scale=____, size=10000, random_state=13)

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