← All open source projects

Polars

pola-rs/polars

Polars is a fast DataFrame engine written in Rust with APIs for Python, Rust, and other environments.

Forks 2,910
Author pola-rs
Language Rust
License MIT
Synced 2026-06-27

What it is

Polars is a fast DataFrame engine written in Rust. It provides APIs for Python, Rust, and other environments, with tabular data processing, lazy execution, expressions, and support for datasets larger than memory.

It became visible as an alternative to familiar table-processing tools when speed and parallel execution matter.

How the approach works

Polars is built around expressions and query optimization. Instead of immediately executing every step, users can describe a transformation chain and let the engine optimize it.

The Rust core provides performance and memory control, while the Python API makes it accessible to analysts and data engineers.

Lazy table transformation

This example shows the Polars style: describe filtering, grouping, and aggregation, then execute with `collect()`.

Language: Python
import polars as pl

result = (
    pl.scan_parquet("events.parquet")
    .filter(pl.col("status") == "paid")
    .group_by("country")
    .agg(pl.col("amount").sum().alias("revenue"))
    .sort("revenue", descending=True)
    .collect()
)

print(result)

What is inside

The repository contains the Rust core, Python package, documentation, tests, examples, data-format support, and build material.

Polars connects a familiar DataFrame style with a modern query engine.

Practical context

It fits large CSV or Parquet files, feature preparation, analytics pipelines, and tasks where single-threaded processing becomes a bottleneck.

Migration should be gradual: compare results, check data types, nulls, dates, and grouping behavior. Speed should not break correctness.

Why it feels fast

Polars is fast for more than being written in Rust. Its expression model, columnar processing, and lazy execution let an operation chain be described first and optimized before data is read and transformed.

For users it still feels like table work: filters, groups, joins, and computed columns. The difference is that an engine underneath tries to run operations in parallel and save memory.

The limitation is different habits from pandas. Some operations are named differently, some behavior is stricter, and lazy execution asks users to think about the query plan. That is the price of performance and a more explicit data model.

The project’s strength is a practical bridge. Users can stay in Python while getting a faster engine for large tables and gradually move heavy processing areas without rewriting the whole system at once.

That makes Polars attractive not only for final analysis, but also for cleaning and preparing data before it moves into models, dashboards, reports, or storage systems.

Strengths and limits

The strength is speed and an expressive API. The limit is difference from pandas and the need to understand lazy execution when using optimization heavily.