Learn  /  Guides

pandas vs Polars in 2026: speed, syntax and which to choose after pandas 3.1 and Polars 2.1

pandas 3.1 borrowed select, filter and col from Polars, and its CSV reader caught up. Is Polars still worth switching to? We benchmarked both and compared the code side by side.

Guide9 min readUpdated 28 October 2026
PythonData analysis
All guides and cheat sheets

For years the choice was simple to describe: pandas is everywhere and easy to start with, Polars is much faster and stricter. In October 2026 both released new versions, and the gap narrowed. pandas 3.1 added Polars-style select, filter and pd.col expressions and a parallel CSV reader, while Polars 2.1 learned to spill huge group-bys to disk and filled out its SQL support. This guide compares them as they stand today, with our own timings.

7.1Times faster filterPolars over pandas, our test
5.5Times faster group-byPolars over pandas, our test
1Line to convertpl.from_pandas or to_pandas

The same pipeline in both

Here is a typical analysis: read a sales file, keep one region, compute revenue, and total it by day. Both versions run as written on pandas 3.1 and Polars 2.1 and return the same 24 rows.

Python
import pandas as pd

sales = pd.read_csv("sales.csv")
north = (
    sales
    .filter(pd.col("region") == "North")
    .assign(revenue=pd.col("amount") * pd.col("qty"))
    .groupby("day", as_index=False)
    .agg(revenue=("revenue", "sum"), orders=("id", "count"))
    .sort_values("revenue", ascending=False)
)

The biggest difference is not the method names but lazy execution. Polars' scan_csv builds a plan and only runs it at collect(), so it can skip columns and rows it does not need. pandas always runs each step immediately.

Speed: our benchmark

We ran common operations on the same 2-million-row table, 90 MB as CSV, on a small 2-core cloud machine, taking the best of five runs. Bars show how many times faster Polars was.

How many times faster Polars 2.1 was than pandas 3.1
Filter on two conditions7.1×
Group-by and aggregate5.5×
Join to a small table2.4×
Read, filter and aggregate1.9×
Sort by one column1.2×
Read a CSV fileabout the same

Our test: 2 million rows, 5 columns, 2-core machine, best of five runs. On machines with more cores Polars usually gains more, because it parallelises most operations.

Operationpandas 3.1Polars 2.1
Read a 90 MB CSV0.15 s0.15 s
Filter on two conditions0.050 s0.007 s
Group by region and day0.127 s0.023 s
Join to a 4-row table0.217 s0.092 s
Sort 2 million rows0.238 s0.198 s
Read, filter and aggregate in one go0.275 s0.148 s

For a file of this size, both are fast enough that the difference rarely matters in a notebook. It matters when the same code runs every hour in a pipeline, or when the data is ten or a hundred times bigger.

Head to head

pandas 3.1

The standard
First release
2008
Execution
eager, mostly single-threaded
Index
row labels
  • Works with almost every Python data library
  • Huge number of tutorials, answers and examples
  • Now has select, filter and pd.col
  • Slower on large data and uses more memory

Best for exploration, small to medium data and anything that feeds plotting or machine learning libraries.

Polars 2.1

The fast one
First release
2020
Execution
lazy or eager, multi-threaded
Index
none
  • Much faster on most operations, and handles data larger than memory
  • Strict types catch mistakes early
  • Built-in SQL that keeps getting more complete
  • Fewer integrations, and less help online

Best for pipelines, large files and repeated jobs where speed and memory matter.

Which should you choose?

  1. 1

    Starting out, or working with Excel users

    Learn pandas first. Most courses, Stack Overflow answers and AI assistants assume it, and pandas 3.1's new syntax makes moving to Polars later easy.

  2. 2

    Data larger than a few gigabytes

    Use Polars, especially with scan_csv or scan_parquet and the streaming engine, which can now spill to disk.

  3. 3

    Scheduled pipelines

    Polars usually costs less to run and fails earlier when data types are wrong.

  4. 4

    Machine learning and charts

    Stay in pandas, or do the heavy preparation in Polars and convert at the end with to_pandas().

  5. 5

    SQL people

    Try DuckDB or Polars SQL. Both query files directly; see our guide to DuckDB 2.0.

Check your understanding

1/3Which pandas 3.1 feature makes its code look more like Polars?

2/3Why can Polars skip unneeded work in a pipeline?

3/3In our test, where was the difference smallest?

Read next: what's new in pandas 3.1, what's new in Polars 2.1, DuckDB 2.0, the pandas cheat sheet and the Polars cheat sheet. Moving from spreadsheets? Start with pandas for Excel users.

Sources: pandas 3.1.0 release notes (22 October 2026); Polars blog, "Announcing Polars 2.1" (27 October 2026); our own benchmark with pandas 3.1.0, Polars 2.1.0 and PyArrow on Python 3.13 on a 2-core machine. Timings are indicative; test on your own data and hardware.

Alessandro Ecclesie AgazziWritten by Alessandro Ecclesie Agazzi, analytics engineer in London. Updated 28 October 2026. About me

Found this useful?

New guides and "what's new" explainers on data and AI land here regularly. Follow along on LinkedIn, or share this one with a colleague.