LazyFrame Reference
polynx.LazyFrame wraps polars.LazyFrame with the complete suite of Polynx string expression methods and enhanced lazy indexing.
Standard Polars LazyFrame Methods
polynx.LazyFrame inherits all native Polars lazy operations and optimization passes.
This page covers only the Polynx-specific lazy extensions. For standard Polars LazyFrame methods, please refer to the Official Polars LazyFrame Reference.
Lazy Execution Model
All operations on a LazyFrame are deferred into a query plan and executed only when .collect() is called:
Methods Inherited from DataFrame
The following methods are implemented for LazyFrame and operate lazily:
query(query_str): Filters the lazy query plan using string expressions.eval(query_str, mode): Evaluates string expressions lazily.assign(query_str): Appends new computed columns lazily.wc(*args, **kwargs): Multi-statement column mutations lazily.gb(gp_keys, expr, with_subtotal): String-powered group by aggregations lazily.dd(): Deduplication maintaining order.dsort(by): Descending sort.asort(by): Ascending sort.describe(...): Evaluates and summarizes metrics.round(decimal): Rounds all float columns lazily.cum_max(): Cumulative maximum lazily.rename(new_cols): Rename by list or dict.unstack(): Pivoting (collects to eager automatically).to_list(col_name): Collects and extracts column list.max(col_name)/min(col_name): Collects and returns scalar.
Lazy Indexing Syntax
Polynx enhances LazyFrame with bracket indexing:
Column Selection
Expression Filtering
Interoperability & Conversions
collect
Execute the query plan and materialize a polynx.DataFrame.
to_polars
Retrieve the underlying native polars.LazyFrame.
to_pandas
Collects the lazy frame and converts the result into a pandas.DataFrame.