BaşlayınÜcretsiz Başlayın

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.

Bu egzersiz

Introduction to Polars

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • 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.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Count songs per artist
artist_counts = spotify_df["artist"].____

# Create a bar plot
fig = px.bar(____, x=____, y=____, title="Number of Songs per Artist")

fig.show()
Kodu Düzenle ve Çalıştır