Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Filtering & Conditional Logic | Paradigm Shift, Selection
Data Wrangling with Polars
Section 1. Chapter 6
single

single

Challenge: Filtering & Conditional Logic

Swipe to show menu

Task

Swipe to start coding

Your task is to implement a function named filter_and_tier_games. This function must perform two consecutive operations:

  1. Filter: Retain only the rows where Positive is strictly greater than 0.

  2. Conditional Logic: Create a new column named Price Tier based on the following criteria:

  • If Price is exactly 0.0, the tier must be Free.

  • If price is greater than 0.0 but less than or equal to 10.0, the tier must be Budget.

  • For all other cases (prices strictly greater than 10.0), the tier must be Premium.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 6
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt