Loading video player…

Working With Python Polars (Overview)

In the world of data analysis and manipulation, Python has long been the go-to language. With extensive and user-friendly libraries like NumPy, pandas, and PySpark, there’s a solution available for almost any data-driven task. Among these libraries, one name that’s been generating a significant amount of buzz lately is Polars.

Polars is a high-performance DataFrame library, designed to provide fast and efficient data processing capabilities. Inspired by the reigning pandas library, Polars takes things to another level, offering a seamless experience for working with large datasets that might not fit into memory.

In this video course, you’ll learn:

  • Why Polars is so performant and attention-grabbing
  • How to work with DataFrames, expressions, and contexts
  • How to read data into DataFrames
  • How to group and aggregate data
  • What the lazy API is and how to build lazy queries
Download

Course Slides (.pdf)

1.1 MB
Download

Sample Code (.zip)

441.2 KB

00:00 Welcome to Working With Python Polars. My name is Christopher, and I will be your guide. This course is an introduction to the Polars library, a more recent addition to the data science space in Python.

00:12 Stick with me and you’ll learn about writing and evaluating expressions to process your data, reading data sources from CSV files, creating subsets within your data to perform aggregation operations like counting and summing, and doing all this with deferred evaluation, which is Polars’ superpower.

00:31 By running a query optimizer before executing operations, Polars can be a really, really speedy bear.

00:39 The code in this course was tested with Python 3.13.2 and Polars 1.22.0.

00:47 Polars is a DataFrame library. What’s that mean? Well, a DataFrame consists of rows and columns and is the equivalent of a spreadsheet in memory. Once you’ve got your data inside a DataFrame, you can run all sorts of operations on it, and Polars is optimized for doing this quickly.

01:03 Generally speaking, it’s faster than pandas while being capable of doing most of the same things. When you want to perform some operations, you create expressions.

01:12 The expression mini-language is based on Python objects, which you string together. This course guides you through your first steps with Polars. It covers how to create and play with DataFrames, how to access parts of a DataFrame, how to execute expressions in order to process your data, how to source data from CSV files into your DataFrame, and how to take advantage of the Polars query optimizer by defining your expression all at once before invoking it.

01:40 Next up, I’ll show you how to create Polars DataFrame.

Become a Member to join the conversation.