Polars 2 · Expressions, grouping and joins

Work with strings

Use the str namespace for text operations.

df.filter(pl.col("name").str.contains("a"))
df.with_columns(pl.col("name").str.len_chars().alias("length"))

Official Polars 2 documentation

More expressions, grouping and joins commands

All expressions, grouping and joins commands · Polars 2 cheatsheet

Was this page helpful?