Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

polars

> 编程语言
Open source

Extremely fast Query Engine for DataFrames, written in Rust

39.2K stars0 likes3 views
WebsiteGitHub

About

Extremely fast Query Engine for DataFrames, written in Rust

Documentation: Python - Rust - Node.js - R | Agents: Skill - MCP | User guide | Discord

Polars: Extremely fast Query Engine for DataFrames

Polars is an analytical query engine for DataFrames, written in Rust. It is designed to be fast, easy to use and expressive. Key features are:

  • Fast: written from the ground up in Rust with multi-threaded, vectorized (SIMD) execution
  • Lazy & eager execution: with query optimization out of the box
  • Larger-than-RAM: the streaming engine processes datasets that don't fit in memory
  • Expressive API: compose complex queries with powerful expressions
  • Extensible: extend Polars natively with custom code through I/O and Expression plugins
  • Multi-language: bindings for Python, Rust, Node.js, R, and SQL
  • GPU support: optionally accelerate queries on NVIDIA GPUs
  • Interoperable: uses the Apache Arrow Columnar Format for zero-copy data sharing

To learn more, read the user guide.

Polars in action

Queries are composed from expressions. This lazy query gets optimized out of the box and runs in parallel across all available cores:

python
import polars as pl

df = (
    pl.scan_parquet("orders.parquet")
    .filter(pl.col("status") == "shipped")
    .group_by("customer_id")
    .agg(
        pl.col("amount").sum().alias("total"),
        pl.len().alias("n_orders"),
    )
    .sort("total", descending=True)
    .collect()
)

Performance

Polars is very fast. In fact, it is one of the best performing Dataframe solutions available. See the PDS-H benchmarks results.

Handles larger-than-RAM data

If you have data that does not fit into memory, Polars' query engine is able to process your query (or parts of your query) in a streaming fashion. This drastically reduces memory requirements, so you might be able to process your 250GB dataset on your laptop. Collect with collect(engine='streaming') to run the query streaming.

Installation

Python

Install the latest Polars version with:

bash
pip install polars

See the User Guide for more details on optional dependencies

Compile Polars from source

If you want a bleeding edge release you should compile Polars from source. Advanced users can also compile for maximum performance for their architecture.

This can be done by going through the following steps in sequence:

  1. Install the latest Rust compiler
  2. Install maturin: pip install maturin
  3. cd py-polars and choose one of the following:
    • make build, slow binary with debug assertions and limited symbols, fast compile times
    • make build-debug, same as make build, but with all symbols, produces large binaries
    • make build-release, fast binary without debug assertions, minimal debug symbols, long compile times
    • make build-nodebug-release, same as build-release but without any debug symbols, slightly faster to compile
    • make build-debug-release, same as build-release but with full debug symbols, slightly slower to compile
    • make build-dist-release, fastest binary, extreme compile times

By default the binary is compiled with optimizations turned on for a modern CPU. Specify LTS_CPU=1 with the command if your CPU is older and does not support e.g. AVX2.

Note that the Rust crate implementing the Python bindings is called py-polars to distinguish from the wrapped Rust crate polars itself. However, both the Python package and the Python module are named polars, so you can pip install polars and import polars.

Check the Installation guide for more advanced installations. For example when you expect more than 2^32 (~4.2 billion) rows, run on an old CPU (e.g. dating from before 2011), or on an x86-64 build of Python on Apple Silicon under Rosetta.

Contributing

Want to contribute? Read our contributing guide and check the issue tracker for accepted issues.

Contributors new to the codebase can look for the good first issue label to get familiar with the project.

You can join the Polars Discord server for any help along the way.

Distributed Polars

Running into hardware limitations executing your queries? Read how you can horizontally scale your Polars query on a cluster.

License

Polars is licensed under the MIT License (SPDX: MIT).

Issues· 2930 open

View all issuesOpen on GitHub
  • #29642

    `Expr.interpolate` panics or silently leaves nulls for non-numeric dtypes

    bugpythonneeds triageA-panicUpdated Sep 30, 2026
  • #29641

    Incorrect CSV for `decimal_comma` and `float_scientific`

    buggood first issueacceptedA-dtype-decimalP-mediumUpdated Sep 30, 2026
  • #22111

    Ignore leading whitespace when reading csv

    enhancementUpdated Sep 29, 2026
  • #29644

    `clip` with a length-1 input and full-length bounds silently truncates to length 1 instead of broadcasting

    bugpythonneeds triageUpdated Sep 29, 2026
  • #29640

    Parquet rows skipped when NaN in Float

    bugpythonacceptedP-highA-io-parquetUpdated Sep 29, 2026
  • #29630

    Incorrect result on `group_by` with `sort_by` after order change in agg

    bugpythonacceptedP-highUpdated Sep 29, 2026
  • #29583

    Incorrect result on `group_by` with `sort_by` in aggregation

    bugpythonacceptedP-highUpdated Sep 29, 2026
  • #29496

    DataFrame.rolling produces incorrect result if window boundaries are not monotone

    bugpythonacceptedP-highA-rollingUpdated Sep 29, 2026
  • #29494

    `pl.date` over hive keys stops partition pruning when combined with an in-file predicate

    performanceA-io-partitioningUpdated Sep 29, 2026
  • #29627

    Incorrect results for in-memory extrumum-by in groupby context on nested keys

    bugpythonneeds triageUpdated Sep 29, 2026

> Tags

Rustarrowdataframedataframe-librarydataframes

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言