1. Learn
  2. /
  3. Courses
  4. /
  5. Sampling in Python

Exercise

Are these findings generalizable?

Let's look at another sample to see if it is representative of the population. This time, you'll look at the duration_minutes column of the Spotify dataset, which contains the length of the song in minutes.

spotify_population and spotify_mysterious_sample2 are available; pandas, matplotlib.pyplot, and numpy are loaded using their standard aliases.

Instructions 1/3

undefined XP
    1
    2
    3
  • Plot a histogram of duration_minutes from spotify_population with bins of width 0.5 from 0 to 15 using pandas .hist().