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

Sampling distribution vs. bootstrap distribution

The sampling distribution and bootstrap distribution are closely linked. In situations where you can repeatedly sample from a population (these occasions are rare), it's helpful to generate both the sampling distribution and the bootstrap distribution, one after the other, to see how they are related.

Here, the statistic you are interested in is the mean popularity score of the songs.

spotify_population (the whole dataset) and spotify_sample (500 randomly sampled rows from spotify_population) are available; pandas and numpy are loaded with their usual aliases.

Bu egzersiz

Sampling in Python

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

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

mean_popularity_2000_samp = []

# Generate a sampling distribution of 2000 replicates
____:
    mean_popularity_2000_samp.append(
    	# Sample 500 rows and calculate the mean popularity 
    	____
    )

# Print the sampling distribution results
print(mean_popularity_2000_samp)
Kodu Düzenle ve Çalıştır