- $49
Effective Polars Third edition
Learn Polars 2.1 with runnable Python examples and diagrams that show how each operation changes the data. We’ll start with raw files and work through cleaning, joins, aggregations, and time series.
(The book is a digital book)
Covers Polars 2.1
Inside the Third Edition
In this book, I'll show real-world data. We will work with practical, applied examples to learn the library's best practices. From setting up a project to analysis in Jupyter, to packaging, testing, creating a Rust extension, and using AI.
What’s new
I’ve updated the examples for Polars 2.1 and revised the diagrams throughout the book. This edition is more than twice as long and adds chapters on CLEANER, Python and Rust extensions, and using AI agents for data analysis.
Learn Polars 2.1 with Python
We'll use vehicle, text, and time-series data to work through examples of cleaning, combining, and analyzing data. We'll build expressions, join DataFrames, and inspect lazy queries. The third edition also covers the CLEANER framework, Python and Rust extensions, and using AI agents to help with data analysis.
See how Polars Works
Diagrams illustrate data manipulations.
Add and select columns
The .with_columns method adds the total to the sales table. The .select method returns the product ID and the total.
Pivot and aggregate mileage
Use the .pivot method to calculate the median city MPG for each model and year.
Complex Joins
Use the .join_asof method to add logic around joining data.
Group into overlapping time windows
The .group_by_dynamic method starts a new one-hour window every 30 minutes. A reading can appear in two windows.
Meet Michael, a Satisfied Reader
Matt Harrison's Effective Polars covers the essential elements of this growing, popular new dataframe library. The book is framed by Matt's transformative programming style which emphasizes good programming structure with chains and other methods. The lessons learned from Matt's work go way beyond python and its dataframe libraries.
The book covers all major topics related to Polars, column selection, row filtering, expressions, joins, pivots, aggregation, lazy and eager queries, streaming, and time series analysis. Differences between Polars and Pandas are often mentioned in the book, with a chapter dedicated to porting from Pandas to Polars. These topics would be expected in any book about the Polars. What sets this book apart is the author's skill at teaching the subject matter and positively affecting the programming practice of his students and readers.
After reading Effective Polars from cover to cover, and completing all the chapter-end exercises, the only think I have left to say is a big thanks to Matt Harrison, and a recommendation to anyone interested in learning about Polars to get this book.
Polars Developer Agrees
"Came for the speed, stayed for the syntax."
That's a common refrain among Polars enthusiasts. And indeed, the Polars API is truly beautiful: not only does it make for very readable code, it also allows you to express complex aggregations which just aren't expressible with the pandas API.
Matt Harrison is a world-renowned pandas expert. I'm a Pandas maintainer. Yet we've both dedicated considerable time to Polars over the past year - not because we want to "kill Pandas" or anything like that, but because we're so excited about the ground-breaking library that Polars is. It's refreshing to see a project have the courage to do things differently and produce such an incredible result - its growing popularity is well-deserved!
When should you use Polars? I think the best time is when you're starting a new project. Porting Pandas code to Polars is certainly possible, as Matt shows here, but it's not necessarily easy. If you try thinking in Polars at the start of a new project, you'll likely surprise yourself with how expressive its API truly is, you'll use it idiomatically, and you'll make full use of its amazing features.
Marco Gorelli
The Video Course
Modern Analytics with Polars, Rust, and AI
Watch and learn
How far did I ride? We’ll answer that using 10,430 GPS readings from one of my bike rides. We’ll start with a Jupyter notebook and turn it into a project someone else can install, run, and test.
Set up the project with uv and use an AI agent to suggest test cases.
Refactor with CLEANER and check each interval distance after upgrading to Polars 2.1.
Compare a Python callback, a native Polars expression, and a Rust plugin. Then build and test a wheel.
Included with the Bundle
Four Skills for your Coding Agent
Give your agent instructions for work you’ll repeat across projects. Each skill describes what the agent should do and what it should check. Open a skill to see an example request.
The course project includes the Jupyter notebook, GPS data, reference interval distances, and Rust source so you can run the analysis yourself.
CLEANER
Prepare raw data in seven steps.
Inspect types and ranges before casting, decide how to handle missing values, and check the output of a reusable cleaning function.
Apply CLEANER to this export. Show me which values became null during parsing and test the final output columns.
Polars Extension
Build and package a Rust expression plugin.
uv + Polars Notebook
Set up a runnable analysis project.
Polars Testing
Write tests using best practices.
Get the Book or the Bundle!
- $49
Effective Polars 2 Digital Book
- Download
- 3 files
- $149
Effective Polars Bundle
- Bundle
- 5 Items
- $249
Effective Polars Consult
- Bundle
- 5 Items
Contents
Files
- 298 KB
- 13.8 MB
- 5.78 MB