1. Học hỏi
  2. /
  3. Khoa Học
  4. /
  5. Data Transformation with Polars

Connected

Bài tập

Building a correlation matrix

Now that you've ranked albums, the strategy team wants to understand which metrics move together. The Spotify dataset has been enriched with streams_billions and streams_per_listener columns. Build a correlation matrix to spot strong and weak relationships between these numeric features.

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

Hướng dẫn

100 XP
  • Pick five numeric columns: streams_billions, monthly_listeners, streams_per_listener, duration_ms, and popularity, and compute the correlation.
  • Add a metric column to the result for better readability.