Get startedGet started for free

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.

This exercise is part of the course

Sampling in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

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)
Edit and Run Code