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

Connected

Exercise

Simple sampling and calculating with NumPy

You can also use numpy to calculate parameters or statistics from a list or pandas Series.

You'll be turning it up to eleven and looking at the loudness property of each song.

spotify_population is available and numpy is loaded as np.

Instructions 1/2

undefined XP
    1
    2
  • Create a pandas Series, loudness_pop, by subsetting the loudness column from spotify_population.
  • Sample loudness_pop to get 100 random values, assigning to loudness_samp.