Polars Rust-based dataframe query engine with expression APIs, lazy optimization and qualified streaming execution.
Overview Polars is a dataframe query engine written in Rust, with expression-based transformation and eager or lazy workflows. Lazy queries can be optimized before execution and processed in batches, making it an alternative for table-analysis code that can adopt its API and data semantics.[1] [3] [8]
Contents Expressions and execution Polars expressions describe column transformations and aggregations. A lazy workflow builds a plan before materializing a result, allowing optimization across operations. The 2.0 upgrade guide makes streaming the default resolution of auto for lazy collection; eager DataFrame operations still use the in-memory engine under auto. These modes should not be conflated.[4] [8]
Streaming and memory limits Streaming evaluates suitable queries in batches instead of requiring every input row at once. Some operations are inherently non-streaming or lack a streaming implementation and can fall back to in-memory execution. The physical query graph helps identify memory-intensive portions. Streaming therefore supports larger-data workflows, but does not establish that an arbitrary query or final materialized result fits within a particular memory budget.[3]
Table and missing-data semantics Polars does not have pandas-style labeled indexes or MultiIndexes; operations identify relevant columns explicitly. It distinguishes null, used for missing data across types, from floating-point NaN, which is a numerical value rather than its missing-data marker. Moving a calculation between libraries requires attention to alignment and missing-value handling, even where the visible source tables look alike.[2] [9]
pandas conversion The to_pandas conversion requires pandas and PyArrow. Its Arrow-backed extension-array option can preserve nulls and permit zero-copy operations, but subsequent pandas operations unsupported by Arrow compute may convert to NumPy. Conversion is a useful integration boundary, not a promise that an entire mixed-library pipeline remains zero-copy or retains every operation's execution behavior.[6]
Version migration Polars 2.0.0 was published on October 6, 2026. Its upgrade guide records changes beyond execution defaults: horizontal concatenation requires equal heights, and exploding an empty list defaults to producing no row rather than a null row. Multi-file CSV inference examines the first ten files by default. These changes can alter errors, row counts or inferred types in existing pipelines.[4] [5]
Licensing and runtime options The library is MIT-licensed and offers Python and Rust installation routes. Default index width limits dataframe row counts; a big-index option expands it. A compatibility runtime supports older CPUs, while GPU, database or spreadsheet integrations require relevant optional components. Installing the core package alone does not establish availability of every optional backend.[1] [7]
Substitution considerations Polars can substitute for pandas where table-processing code can be rewritten around expressions and explicit columns. Evaluate query plans and conversion boundaries rather than assuming a universal performance advantage. Index-dependent code, missing-value rules and version changes are concrete migration costs even when both libraries offer joins and aggregations.[2] [3] [4] [6]
Also included: 3 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.