Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Dates & Times | Strings, Dates, Missing Data
Data Wrangling with Polars
Section 3. Chapter 4
single

single

Challenge: Dates & Times

Swipe to show menu

Task

Swipe to start coding

Implement the function parse_release_dates(df: pl.DataFrame) -> pl.DataFrame.

  • Use the .with_columns() context to overwrite the existing column named exactly "Release date".

  • Apply .str.to_date() to the target column using the layout string format %b %d, %Y (which maps to formats like "Dec 10, 2020").

  • Pass strict=False inside .to_date() to handle malformed dates defensively.

  • Return the updated Polars DataFrame.

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 3. Chapter 4
single

single

Ask AI

expand

Ask AI

ChatGPT

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

some-alt