API Reference
Welcome to the Polynx API reference. This section contains detailed documentation of all classes, methods, and functions provided by Polynx.
Reference Sections
- :material-table: __[DataFrame](dataframe.md)__
---
String querying, multi-statement assignments, group aggregations, sorting, and statistical utilities.
- :material-timer-sand: __[LazyFrame](lazyframe.md)__
---
Deferred query execution, lazy string expressions, lazy column indexing, and query collection.
- :material-format-list-numbered: __[Series](series.md)__
---
Polars Series wrapper with sequence indexing, length operations, and data export.
- :material-code-parentheses: __[Expressions (Expr)](expr.md)__
---
Window aggregations, rolling product calculation, and method chaining.
- :material-code-tags: __[String DSL Functions](dsl.md)__
---
Functions callable within string expressions: `case_when`, `select`, `where`, `mondf`, horizontal operations, and `@var`.
- :material-swap-horizontal: __[Input / Output & Merge](io.md)__
---
Pandas-style `plx.merge()`, top-level Polars functions (`concat`, `read_csv`, `read_parquet`), and unwrapping.
- :material-tune: __[Configuration & Cache](config.md)__
---
Cache modes (`raw`, `hash`, `custom_lru`, `none`), capacity management, and diagnostic metrics.
- :material-function: __[User Defined Functions (UDF)](udf.md)__
---
Custom Python function registration for invocation inside string expressions.
Quick Reference Table
| Function / Method | Category | Description |
|---|---|---|
df.query(query_str) |
DataFrame | Filter rows using string expressions with variable substitution |
df.eval(query_str, mode) |
DataFrame | Evaluate mathematical or string expressions returning calculated columns |
df.assign(query_str) |
DataFrame | Append calculated columns evaluated from string expressions |
df.wc(*args, **kwargs) |
DataFrame | Extended with_columns supporting multi-statement assignment strings |
df.gb(gp_keys, expr, with_subtotal) |
DataFrame | Group by with string aggregation expressions and optional subtotals |
df.describe(group_keys, ...) |
DataFrame | Extended descriptive statistics supporting group keys |
df.dd() |
DataFrame | Deduplicate rows keeping first occurrence and maintaining order |
df.dsort(by) |
DataFrame | Sort rows in descending order |
df.asort(by) |
DataFrame | Sort rows in ascending order |
df.unstack() |
DataFrame | Pivot DataFrame using last two columns as keys and values |
df.vcnt(col) |
DataFrame | Value counts grouped by column(s), sorted descending |
df.ucnt(col) |
DataFrame | Total distinct / unique row count as a scalar integer |
df.round(decimal) |
DataFrame | Round all floating-point columns to specified decimal places |
df.cum_max() |
DataFrame | Cumulative maximum across all floating-point columns |
df.to_list(col_name) |
DataFrame | Extract column values directly as a Python list |
df.max(col_name) |
DataFrame | Extract scalar maximum value from a column |
df.min(col_name) |
DataFrame | Extract scalar minimum value from a column |
df.size(unit, return_size) |
DataFrame | Inspect and report estimated memory footprint |
df.rename(new_cols) |
DataFrame | Rename columns using either a dictionary mapping or a list of new names |
df.pplot(*args, **kwargs) |
DataFrame | Quick plotting via Pandas plotting API |
df.to_polars() |
Interop | Return native polars.DataFrame |
df.to_pandas() |
Interop | Return native pandas.DataFrame |
expr.rolling_prod(...) |
Expr | Rolling window product via log-sum-exp |
plx.merge(left, right, ...) |
Functions | Pandas-style DataFrame join with automatic overlapping column suffixes |
case_when(conds, choices, default) |
String DSL | Conditional branching supporting multi-condition lists or ternary pairs |
select(conds, choices, default) |
String DSL | Multi-condition branching mirroring numpy.select |
where(cond, choice, default) |
String DSL | Ternary condition branching mirroring numpy.where |
mondf(beg_date, end_date) |
String DSL | Calculate difference in months between two date/datetime columns |
max_horizontal(...) |
String DSL | Compute row-wise maximum across columns |
min_horizontal(...) |
String DSL | Compute row-wise minimum across columns |
plx.register_udf(name, fn) |
UDF | Register Python function for use inside string expressions |
plx.config.set_cache_mode(mode) |
Config | Configure expression caching backend (raw, hash, custom_lru, none) |
plx.clear_all_expr_caches() |
Config | Clear all internal expression caches |