1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Polars

Connected

Exercise

Counting values

You want to understand which artists have the most songs in the Spotify dataset. Let's count the number of songs per artist and visualize the results.

The spotify_df DataFrame is available for you, and Plotly Express is imported as px.

Instructions

100 XP
  • Count the number of songs per artist using .value_counts() on the "artist" column, and sort the output.
  • Create a bar plot using Plotly Express to visualize the counts.