Polars

Polars DataFrame library

A fast, multi-threaded DataFrame library written in Rust, with lazy execution and query optimization.

ActiveMediumv2.1.0MITScientific Computing & Data Processing Libraries

Official documentationTry the examples

Basic information

NamePolars
Full namePolars DataFrame library
CategoryScientific Computing & Data Processing Libraries
DeveloperRitchie Vink and the Polars community
Release yearNot specified
Official websitewww.pola.rs
GitHub repositorypola-rs/polars
Official documentationdocs.pola.rs/api/python/stable/reference/index.html
Package on PyPIpolars
LicenseMIT (PyPI classifier)
Project statusActive Had a release in the last 12 months
Latest version25 October 2026 (version 2.1.0)
Programming languageRust, Python
Operating systemsOS Independent (as declared by the package on PyPI)
Required Python version>=3.11
Difficulty levelMedium

Data last checked: 21 November 2026 — source: PyPI JSON API (2026-11-21)

Overview

Polars processes tables in the columnar Apache Arrow format and uses all CPU cores automatically. It offers an expressions API and a lazy execution mode that optimises the query before running it, and can process data larger than memory in batches.

A practical alternative to pandas when performance becomes a bottleneck, with a different API that takes some learning.

When to choose it? Choose it for large tables on a single machine when pandas performance is not enough.

Uses

Main uses

  • Processing large tables quickly
  • Optimised lazy queries
  • Reading large Parquet and CSV files

Scientific fields

  • Data engineering
  • Data science

Suitable project types

  • Preparing large training data
  • Data processing pipelines

Research applications

  • Processing logs and large experimental data

Tabular data analysisBig data and parallel table processing

Technical features

A feature is shown as "Supported" only if it is documented in the library's official documentation; anything we have not verified is shown as "Not specified".

CPU supportSupported
GPU supportPartial or through an add-onThere is an experimental/optional GPU engine based on RAPIDS cuDF according to the Polars documentation; check its status in the official docs.
CUDA compatibilityPartial or through an add-on
Distributed training or computingNot supported
Automatic differentiation (Autodiff)Not supported
Model deploymentNot applicable
Pre-trained modelsNot applicable
Supported data typesApache Arrow types: numbers, strings, dates, lists and structs
Integration with other librariespyarrow, Pandas, NumPy
Flexibility (editorial estimate)High
Performance (editorial estimate)Very high on the CPU
Community (editorial estimate)Growing fast
Documentation quality (editorial estimate)A user guide and API reference

Installation and running

Shell
pip install polars

Compatibility: Python >=3.11 — according to the package data on PyPI, checked on 21 November 2026

Installing inside a virtual environment (venv or conda) is recommended. If you need compatibility with a specific CUDA version or operating system, refer to the official documentation, because this information changes with every release.

Code examples

Examples marked "Run and tested" were actually run, with their output, test date and library versions recorded; the others need a GPU or model downloads, so they were not run in the test environment.

MediumA lazy query in PolarsRun and tested

Goal: Building a query plan that Polars optimises before execution.

Python — example.py
import polars as pl

df = pl.DataFrame({
    "city": ["بغداد", "البصرة", "بغداد", "الديوانية", "البصرة", "بغداد"],
    "sales": [120, 80, 150, 60, 95, 130],
})
q = (df.lazy()
       .filter(pl.col("sales") > 70)
       .group_by("city")
       .agg(pl.col("sales").sum().alias("total"), pl.len().alias("n"))
       .sort("total", descending=True))
print(q.collect())

Code explanation

With lazy() nothing runs until collect(), so Polars fuses filtering and aggregation and reads only the needed columns. This is what makes it faster than pandas on large tables.

Requirements

Shell
pip install polars

How to run

Save the code in a file example.py then run it:

Shell
python example.py

Output recorded during testing

shape: (2, 3)
┌────────┬───────┬─────┐
│ city   ┆ total ┆ n   │
│ ---    ┆ ---   ┆ --- │
│ str    ┆ i64   ┆ u32 │
╞════════╪═══════╪═════╡
│ بغداد  ┆ 400   ┆ 3   │
│ البصرة ┆ 175   ┆ 2   │
└────────┴───────┴─────┘

This example was actually run and tested on 21 November 2026 on a CPU — polars 2.1.0, python 3.13.18

Example page

All Polars examples in the Code Explorer

Pros

  • High performance and automatic use of all cores
  • Lazy execution and query optimization

Limitations

  • A different API from pandas
  • Some libraries expect pandas, so a conversion is needed

References and verification

  • Official website A link the package officially declares on PyPI

    https://www.pola.rs/

    Checked on: 21 November 2026 — reviewed by: the DLArabic team

  • Official documentation A link the package officially declares on PyPI

    https://docs.pola.rs/api/python/stable/reference/index.html

    Checked on: 21 November 2026 — reviewed by: the DLArabic team

  • Official repository A link the package officially declares on PyPI

    https://github.com/pola-rs/polars

    Checked on: 21 November 2026 — reviewed by: the DLArabic team

  • Package page on PyPI (source of the version, licence and release date) Checked directly

    https://pypi.org/project/polars/

    Checked on: 21 November 2026 — version checked: 2.1.0 — reviewed by: the DLArabic team

  • Official website A link the package officially declares on PyPI

    https://www.pola.rs/

    Checked on: 21 November 2026 — reviewed by: the DLArabic team

  • Official documentation A link the package officially declares on PyPI

    https://docs.pola.rs/api/python/stable/reference/index.html

    Checked on: 21 November 2026 — reviewed by: the DLArabic team

  • Official repository A link the package officially declares on PyPI

    https://github.com/pola-rs/polars

    Checked on: 21 November 2026 — reviewed by: the DLArabic team

History of verified versions

VersionRelease dateChecked on
2.1.025 October 202621 November 2026

Page information last reviewed: 21 November 2026. The description was written originally for the encyclopedia and is not copied from the official websites.

Report information that needs updating