Polars

raw JSON →
1.40.1 verified Tue May 12 auth: no python install: verified quickstart: verified

Polars is a blazingly fast DataFrame library implemented in Rust with a Python interface. Current version is 1.40.1. It follows a rapid release cadence with frequent minor and patch releases.

pip install polars
error TypeError: 'Expr' object is not callable
cause Using pl.col('name') as a function call instead of an expression.
fix
Use pl.col('name') as an expression, e.g., df.select(pl.col('name')). Do not add parentheses after it.
error AttributeError: module 'polars' has no attribute 'DataFrame'
cause Installed polars-lts-cpu or polars-u64-id instead of the main polars package, or wrong import path.
fix
Install the correct package: pip install polars. Verify import with 'import polars as pl; print(pl.__version__)'.
error ComputeError: could not include module ...
cause Using a deprecated or removed function due to version mismatch.
fix
Check Polars release notes for removed functions and update your code accordingly. Use stable APIs like pl.col() or pl.lit().
error PanicException: called `Result::unwrap()` on an `Err` value
cause Internal error in Rust backend, often due to unsupported data types or operations.
fix
Ensure data types are compatible. If persists, report a bug with a minimal reproducible example on GitHub.
breaking Starting from Polars 1.0, default behavior may differ from previous major versions. Check migration guide.
fix Review the 1.0 migration guide: https://pola-rs.github.io/polars/py-polars/html/reference/migration/1.0.html
deprecated The 'retries' parameter in read functions is deprecated; use 'storage_options={"max_retries": n}' instead.
fix Replace retries=n with storage_options={'max_retries': n} when reading from cloud storage.
deprecated Support for the DataFrame interchange protocol is deprecated and will be removed in a future version.
fix Use Polars' own interoperability functions (e.g., to_arrow, from_arrow) instead.
gotcha Polars is lazy by default; operations build a query plan until collect() is called. Forgetting to call collect() returns a LazyFrame, not a DataFrame.
fix Always call .collect() on LazyFrame to execute and get a DataFrame.
pip install 'polars[all]'
python os / libc variant status wheel install import disk
3.10 alpine (musl) all - - - -
3.10 alpine (musl) numpy,pandas,pyarrow - - 0.35s 510.7M
3.10 alpine (musl) rt64 - - 0.35s 361.8M
3.10 alpine (musl) polars - - 0.34s 194.3M
3.10 alpine (musl) polars-lts-cpu - - - -
3.10 slim (glibc) all - - 0.32s 1.1G
3.10 slim (glibc) numpy,pandas,pyarrow - - 0.25s 480M
3.10 slim (glibc) rt64 - - 0.25s 361M
3.10 slim (glibc) polars - - 0.24s 194M
3.10 slim (glibc) polars-lts-cpu - - 0.22s 302M
3.11 alpine (musl) all - - - -
3.11 alpine (musl) numpy,pandas,pyarrow - - 0.56s 526.2M
3.11 alpine (musl) rt64 - - 0.54s 364.4M
3.11 alpine (musl) polars - - 0.59s 196.9M
3.11 alpine (musl) polars-lts-cpu - - - -
3.11 slim (glibc) all - - 0.55s 1.1G
3.11 slim (glibc) numpy,pandas,pyarrow - - 0.44s 494M
3.11 slim (glibc) rt64 - - 0.43s 364M
3.11 slim (glibc) polars - - 0.44s 197M
3.11 slim (glibc) polars-lts-cpu - - 0.46s 309M
3.12 alpine (musl) all - - - -
3.12 alpine (musl) numpy,pandas,pyarrow - - 0.53s 511.0M
3.12 alpine (musl) rt64 - - 0.47s 356.1M
3.12 alpine (musl) polars - - 0.45s 188.6M
3.12 alpine (musl) polars-lts-cpu - - - -
3.12 slim (glibc) all - - 0.84s 1.0G
3.12 slim (glibc) numpy,pandas,pyarrow - - 0.47s 479M
3.12 slim (glibc) rt64 - - 0.47s 355M
3.12 slim (glibc) polars - - 0.46s 188M
3.12 slim (glibc) polars-lts-cpu - - 0.41s 299M
3.13 alpine (musl) all - - - -
3.13 alpine (musl) numpy,pandas,pyarrow - - 0.56s 509.5M
3.13 alpine (musl) rt64 - - 0.44s 355.4M
3.13 alpine (musl) polars - - 0.43s 187.8M
3.13 alpine (musl) polars-lts-cpu - - - -
3.13 slim (glibc) all - - 0.49s 1.1G
3.13 slim (glibc) numpy,pandas,pyarrow - - 0.48s 478M
3.13 slim (glibc) rt64 - - 0.48s 355M
3.13 slim (glibc) polars - - 0.45s 188M
3.13 slim (glibc) polars-lts-cpu - - 0.38s 297M
3.9 alpine (musl) all - - - -
3.9 alpine (musl) numpy,pandas,pyarrow - - - -
3.9 alpine (musl) rt64 - - - -
3.9 alpine (musl) polars - - - -
3.9 alpine (musl) polars-lts-cpu - - - -
3.9 slim (glibc) all - - 0.34s 1008M
3.9 slim (glibc) numpy,pandas,pyarrow - - 0.29s 450M
3.9 slim (glibc) rt64 - - 0.30s 298M
3.9 slim (glibc) polars - - 0.29s 162M
3.9 slim (glibc) polars-lts-cpu - - 0.26s 301M

Simple example creating a DataFrame and applying a filter.

import polars as pl

df = pl.DataFrame({'name': ['Alice', 'Bob'], 'age': [30, 25]})
print(df.filter(pl.col('age') > 26))