Data Analysis with Polars
About This Course
Polars is a DataFrame library built for speed and for a consistent API. This course teaches you to use it well, and to write analysis code that stays readable as it grows.
Day one covers everyday analysis: loading data, selecting and filtering it with expressions, handling dates and times, and grouping to produce the summaries you actually report on. If you already know Pandas, much of this is learning how the same job is expressed in Polars, and why the expression API tends to produce shorter and more predictable code.
Day two goes deeper. You work with data too large to load at once using the lazy API, and see enough of how Polars works underneath — the Arrow memory format, how queries are planned — to understand why some pipelines are fast and others are not. We spend time on messy real-world data: missing values that need imputing or interpolating, inconsistent types, and datasets that have to be combined before they can be analysed.
Exercises use real datasets, and you write code in every section.
Who This Course Is For
Data analysts, quants, engineers and scientists who already work with tabular data in Python and want it to be faster and less fiddly. It suits people hitting the limits of Pandas on datasets that no longer fit comfortably in memory, and teams standardising on Polars for new work.
Prerequisites
This course is designed to be able to be completed immediately after completing Python Charmers' Introduction to Python course, or equivalent programming experience (approximately 3 months of regular usage).
If you are a regular Pandas user, the course is a direct route to doing the same work in Polars; no prior Polars experience is assumed.
What You'll Learn
- Load data into Polars from the formats you actually receive it in: CSV, Excel, JSON, Parquet and SQL databases.
- Write readable analysis pipelines that run in memory or over chunked data.
- Summarise and reshape tabular data for reporting and analysis.
- Combine datasets from several sources, resolving the mismatches between them.
- Clean and validate messy real-world data, including missing values that need imputing or interpolating.
- Work with datasets larger than memory using the lazy API, and understand what governs whether a query is efficient.
Course Syllabus
Day 1: Working with Polars
- Introduction to Polars, and how it compares with Pandas
- Everyday analysis in Polars: DataFrames, data types
- Eager vs lazy computation for out-of-memory datasets and analysis
- Expressions for selecting data, filtering data
- Working with dates and times
- Groupby operations for pivot tables and categorical analysis
Day 2: Polars in depth
- The Polars Lazy API in more depth
- Polars internals, including the Arrow memory format
- Working with Strings in depth
- Expressions in depth including structs and user-defined functions
- Performance and scale
- Working with the wider Python ecosystem