polars

Process and transform tabular data with Polars expression-based DataFrame operations.

46.6k|4.2k|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/K-Dense-AI/claude-scientific-skills --skill polars-k-dense-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: polars
Source: https://github.com/K-Dense-AI/claude-scientific-skills/tree/main/skills/polars
Command: npx skills add https://github.com/K-Dense-AI/claude-scientific-skills --skill polars-k-dense-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires polars, and includes references (resource) components.

What problem does it solve? Working with large datasets in pandas often means slow single-threaded execution, silent type conversions, and memory-heavy row-oriented processing. This Skill provides guidance for using Polars, a DataFrame library built on Apache Arrow, to run expression-based transformations with lazy query optimization, parallel execution, and streaming out-of-core processing. ## Core Features & Use Cases - Expression-Based Data Manipulation: Select, filter, group, aggregate, and apply window functions using composable expressions that parallelize automatically. - Lazy Evaluation and Streaming: Build optimized query plans with predicate and projection pushdown, and process datasets larger than RAM via the streaming engine. - Pandas Migration: Map common pandas operations (groupby, transform, merge, melt) to their Polars equivalents with a complete migration reference. - Use Case: You have a 10GB CSV of transaction logs. Use lazy scanning to filter and aggregate only the needed columns, then collect results with the streaming engine without loading the full file into memory. ## Quick Start Ask the agent to read a CSV or Parquet file with Polars, filter rows by a condition, group by a column, and compute summary aggregations.

Frequently Asked Questions about polars

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from pandas to Polars?▼

Pandas to Polars migration maps df["col"] to df.select("col"), boolean indexing to df.filter(), assign to with_columns(), and groupby().transform() to .over() window expressions. Polars has no index, enforces strict typing, and parallelizes operations by default.

How do I process files larger than memory in Polars?▼

Use lazy scanning with pl.scan_csv() or pl.scan_parquet() instead of eager reads, then call collect(engine="streaming") to process data in chunks. You can also stream results directly to disk with sink_parquet().

What is the difference between Polars DataFrame and LazyFrame?▼

A DataFrame executes operations immediately (eager), while a LazyFrame builds a query plan that Polars optimizes before execution. Lazy mode enables predicate pushdown, projection pushdown, and streaming, making it preferred for large datasets and complex pipelines.

Does Polars support reading from S3, Azure, and Google Cloud Storage?▼

Yes, Polars reads and writes Parquet and other formats directly from s3://, az://, and gs:// URIs. Use credential providers such as CredentialProviderAWS or Azure DefaultAzureCredential rather than hardcoding secrets.

Why is my Polars code running slowly?▼

Slow Polars code usually comes from Python lambdas in map_elements, eager reads of large files, or sequential pipe chains that disable parallelization. Stay within the expression API, use lazy mode, and filter and select columns early in the pipeline.

When should I use pandas instead of Polars?▼

Pandas may fit better for complex index-based time series operations, libraries that only accept pandas input, or small datasets where performance is not critical. Polars is preferable for large datasets, strict typing, and parallel execution.