---
name: "polars-rust-dataframe-opt"
description: "Process multi-gigabyte tabular datasets at maximum speed with Polars expressions."
metadata:
  author: "Polars"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "use polars dataframe python"
  - "aggregate data polars"
  - "write polars expression"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Polars Rust-Powered Fast DataFrame Expressions

Harnesses Polars in Python: column expressions (pl.col), fast aggregations, window functions, parallel multi-threaded query execution, and sub-second analytical aggregations.

## When to Invoke
Invoke this skill whenever you need to:
- use polars dataframe python
- aggregate data polars
- write polars expression

## Execution SOP & Rules
1. Write queries using column expressions: df.select(pl.col('amount').sum().over('customer_id')).
2. Use pl.when(cond).then(val).otherwise(other) for fast vectorized conditional logic.
3. Avoid converting Polars DataFrames to Pandas or Python lists during intermediate query steps.
4. Leverage multi-threaded CPU execution automatically enabled in Polars engine.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
