Polars 2 · Basics

Filter rows

Keep rows that match a condition. Combine conditions with & and |.

df.filter((pl.col("age") > 30) & (pl.col("team") == "a"))

Official Polars 2 documentation

More basics commands

All basics commands · Polars 2 cheatsheet

Was this page helpful?