Polars
Polars DataFrame library
A fast, multi-threaded DataFrame library written in Rust, with lazy execution and query optimization.
Basic information
| Name | Polars |
|---|---|
| Full name | Polars DataFrame library |
| Category | Scientific Computing & Data Processing Libraries |
| Developer | Ritchie Vink and the Polars community |
| Release year | Not specified |
| Official website | www.pola.rs |
| GitHub repository | pola-rs/polars |
| Official documentation | docs.pola.rs/api/python/stable/reference/index.html |
| Package on PyPI | polars |
| License | MIT (PyPI classifier) |
| Project status | Active Had a release in the last 12 months |
| Latest version | 25 October 2026 (version 2.1.0) |
| Programming language | Rust, Python |
| Operating systems | OS Independent (as declared by the package on PyPI) |
| Required Python version | >=3.11 |
| Difficulty level | Medium |
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
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 support | Supported |
|---|---|
| GPU support | Partial 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 compatibility | Partial or through an add-on |
| Distributed training or computing | Not supported |
| Automatic differentiation (Autodiff) | Not supported |
| Model deployment | Not applicable |
| Pre-trained models | Not applicable |
| Supported data types | Apache Arrow types: numbers, strings, dates, lists and structs |
| Integration with other libraries | pyarrow, 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
pip install polarsCompatibility: 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.
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.
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
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
| Version | Release date | Checked on |
|---|---|---|
| 2.1.0 | 25 October 2026 | 21 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.
