Python reference

Polars
cheat sheet.

DataFrames, expressions, joins, file formats, and reporting with Polars. Includes lazy queries, streaming, and data quality checks.

50 topics52 code examplesUpdated
How Polars fits together
01Understand the tableKnow what a row means and which types each column needs.
02Describe the workUse expressions to clean, check, and transform values.
03Choose executionExplore eagerly or optimize and stream a file query.
04Check and exportValidate the result and write a suitable typed output.
Jump to a specific topic

Choose a chapter

7 chapters · 50 topics

CHAPTER 02 / 07

Select, filter, and transform

Use Polars select, with_columns, and filter to transform data. Python examples cover nulls, duplicates, strings, dates, and time zones.

9 topics
CHAPTER 03 / 07

Joins, grouping, and aggregation

Join and aggregate Polars DataFrames with group_by, windows, and as-of joins. Reshape tables and work with lists, structs, and nested JSON.

10 topics
CHAPTER 04 / 07

File formats and data interchange

Read and write CSV, Parquet, JSON, and Excel with Polars. Exchange Arrow and pandas data, combine files, and scan partitioned cloud datasets.

13 topics