Aan de slagGa gratis aan de slag

Custom summaries with describe

To wrap up your analysis of the Spotify dataset, leadership needs a summary that matches their reporting thresholds. Generate statistics for popularity and monthly_listeners with custom percentiles at 10%, 50%, and 90% to capture the full distribution.

polars is loaded as pl. The DataFrame spotify is preloaded for you.

Deze oefening maakt deel uit van de cursus

Data Transformation with Polars

Cursus bekijken

Oefeninstructies

  • Select the popularity and monthly_listeners columns.
  • Generate a summary with percentiles at 0.10, 0.50, and 0.90.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Create a summary with custom percentiles
result = spotify.select("____", "____").____(
    percentiles=[____, 0.50, 0.90]
)

print(result)
Code bewerken en uitvoeren