1. เรียนรู้
  2. /
  3. Courses
  4. /
  5. Data Transformation with Polars

Connected

Exercises

Categorizing customers with conditions

Now you'll learn to create conditional expressions. The market research team wants to identify satisfied customers for a follow-up survey - customers with ratings of 4 or higher should be flagged.

The reviews DataFrame is available with 5 rows printed to preview.

คำแนะนำ

100 XP
  • Check if the "rating" column is greater than or equal to 4.
  • Return "Yes" when the condition is True.
  • Return "No" when the condition is False.