polars
Blazingly fast DataFrame library
Pandas was designed when datasets fit comfortably in a few GB and multi-core CPUs were a novelty. Today, pandas is slow on large datasets, uses more memory than necessary, and runs single-threaded by default. Polars was rebuilt from scratch in Rust with a query optimiser and multi-threaded execution engine.
Polars uses a lazy evaluation model: instead of running operations immediately, it builds a query plan. When you call .collect(), the optimiser rewrites the plan to eliminate redundant work, push filters down, and parallelise across all CPU cores. Think of it like SQL โ the engine decides how to execute, not you.
Install polars
pip install polars
import polarsUse it when
Use Polars for data transformation on datasets over 500MB, in production data pipelines where speed matters, or anywhere you're hitting pandas memory limits. It's also a good choice for new projects even on small data โ the API is cleaner and the performance headroom is free.
Skip it when
The ML ecosystem (scikit-learn, PyTorch, statsmodels) speaks NumPy arrays and pandas DataFrames. You'll need to call .to_pandas() or .to_numpy() at the handoff point, which adds friction. For quick exploratory work in a Jupyter notebook, pandas' ecosystem and familiarity often wins.
Ready to explore the full API?
See every class, function, and relationship in an interactive graph.