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

Connected

Exercise

Replacing missing values

You are preparing data for a machine learning model. In this case, you don't want to drop rows with missing values, instead you want to replace them with different approaches for different kinds of columns.

The spotify_df DataFrame is available for you.

Instructions

100 XP
  • Replace null values in the "streams" column with the .mean() of the "streams" column.
  • Replace null values in the "title" column with the string "Unknown".