MulaiMulai sekarang secara gratis

Plotting the sample mean

Now let's plot the sample mean, so you can see more clearly how it evolves as more data becomes available.

For this exercise we'll again use the sample you generated earlier, which is available in the sample variable. The binom object and describe() function have already been imported for you from scipy.stats, and matplotlib.pyplot is available as plt.

Latihan ini adalah bagian dari kursus

Foundations of Probability in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Calculate sample mean and store it on averages array
averages = []
for i in range(____, ____):
    averages.____(____(sample[0:____]).____)
Edit dan Jalankan Kode