Aan de slagGa gratis aan de slag

Filtering with a single condition

You're analyzing streaming data from Spotify and want to focus on tracks that reached a certain level of popularity. You have access to a dataset containing daily streaming counts for songs that were ranked number one on a given day.

The DataFrame spotify_df has been created for you.

Deze oefening maakt deel uit van de cursus

Introduction to Polars

Cursus bekijken

Oefeninstructies

  • Filter spotify_df to show only songs that have more than 10,000,000 "streams".

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Filter for songs with more than 10 million streams
popular_songs = spotify_df.____

print(popular_songs)
Code bewerken en uitvoeren