Agent skill

Polars

by davila7 in davila7/claude-code-templates

Fast DataFrame library (Apache Arrow). An agent skill from davila7/claude-code-templates.

MITAuto-check passedData & Analytics

Install Polars

skills CLI
$ npx skills add davila7/claude-code-templates --skill polars -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davila7/claude-code-templates polars --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/scientific/polars .claude/skills/polars && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
polars
GitHub stars
32k
Used in
14 other repos
Token cost
~2.3k tokens
SKILL.md length
545 words
Files
7 (incl. references)
Skills in repo
478
Repo updated
First seen
Licence
MIT

At a glance

Fast DataFrame library (Apache Arrow). An agent skill from davila7/claude-code-templates.

  • Works in 5 steps: Use lazy evaluation for large datasets → Avoid Python functions in hot paths → Use streaming for very large data → …
  • Tasks that involve DataFrames
  • SKILL.md covers Overview, Quick Start, Core Concepts and Common Operations, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Polars is an agent skill from davila7/claude-code-templates. Fast DataFrame library (Apache Arrow). Select, filter, groupby, joins, lazy evaluation, CSV/Parquet I/O, expression API, for high-performance data analysis workflows.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/best_practices.md`, `references/core_concepts.md` and `references/io_guide.md`).

It sits in Data & Analytics, covering DataFrames. It works with Polars. The repository describes itself as: CLI tool for configuring and monitoring Claude Code. The licence is MIT.

When your agent uses it

  • Tasks that involve DataFrames

Example prompts

  • “/polars”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Use lazy evaluation for large datasets
  2. Avoid Python functions in hot paths
  3. Use streaming for very large data
  4. Select only needed columns early
  5. Use appropriate data types

What it can do on your machine

Read from SKILL.md and the folder at commit 46b4d8b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Polars loads about 2.3k tokens when it runs, and up to ~20k if it reads all its reference files. Until then it costs about 44 tokens; SKILL.md has 545 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~20k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from davila7/claude-code-templates at commit 46b4d8b, republished under its MIT licence (© davila7). 545 words, ~2,302 tokens.

Download SKILL.mdSave it as .claude/skills/polars/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
polars
description
Fast DataFrame library (Apache Arrow). Select, filter, group_by, joins, lazy evaluation, CSV/Parquet I/O, expression API, for high-performance data analysis workflows.

Polars

Overview

Polars is a lightning-fast DataFrame library for Python and Rust built on Apache Arrow. Work with Polars' expression-based API, lazy evaluation framework, and high-performance data manipulation capabilities for efficient data processing, pandas migration, and data pipeline optimization.

Quick Start

Installation and Basic Usage

Install Polars:

python
uv pip install polars

Basic DataFrame creation and operations:

python
import polars as pl

# Create DataFrame
df = pl.DataFrame({
    "name": ["Alice", "Bob", "Charlie"],
    "age": [25, 30, 35],
    "city": ["NY", "LA", "SF"]
})

# Select columns
df.select("name", "age")

# Filter rows
df.filter(pl.col("age") > 25)

# Add computed columns
df.with_columns(
    age_plus_10=pl.col("age") + 10
)

Core Concepts

Expressions

Expressions are the fundamental building blocks of Polars operations. They describe transformations on data and can be composed, reused, and optimized.

Key principles:

  • Use pl.col("column_name") to reference columns
  • Chain methods to build complex transformations
  • Expressions are lazy and only execute within contexts (select, with_columns, filter, group_by)

Example:

python
# Expression-based computation
df.select(
    pl.col("name"),
    (pl.col("age") * 12).alias("age_in_months")
)
Lazy vs Eager Evaluation

Eager (DataFrame): Operations execute immediately

python
df = pl.read_csv("file.csv")  # Reads immediately
result = df.filter(pl.col("age") > 25)  # Executes immediately

Lazy (LazyFrame): Operations build a query plan, optimized before execution

python
lf = pl.scan_csv("file.csv")  # Doesn't read yet
result = lf.filter(pl.col("age") > 25).select("name", "age")
df = result.collect()  # Now executes optimized query

When to use lazy:

  • Working with large datasets
  • Complex query pipelines
  • When only some columns/rows are needed
  • Performance is critical

Benefits of lazy evaluation:

  • Automatic query optimization
  • Predicate pushdown
  • Projection pushdown
  • Parallel execution

For detailed concepts, load references/core_concepts.md.

Common Operations

Select

Select and manipulate columns:

python
# Select specific columns
df.select("name", "age")

# Select with expressions
df.select(
    pl.col("name"),
    (pl.col("age") * 2).alias("double_age")
)

# Select all columns matching a pattern
df.select(pl.col("^.*_id$"))
Filter

Filter rows by conditions:

python
# Single condition
df.filter(pl.col("age") > 25)

# Multiple conditions (cleaner than using &)
df.filter(
    pl.col("age") > 25,
    pl.col("city") == "NY"
)

# Complex conditions
df.filter(
    (pl.col("age") > 25) | (pl.col("city") == "LA")
)
With Columns

Add or modify columns while preserving existing ones:

python
# Add new columns
df.with_columns(
    age_plus_10=pl.col("age") + 10,
    name_upper=pl.col("name").str.to_uppercase()
)

# Parallel computation (all columns computed in parallel)
df.with_columns(
    pl.col("value") * 10,
    pl.col("value") * 100,
)
Group By and Aggregations

Group data and compute aggregations:

python
# Basic grouping
df.group_by("city").agg(
    pl.col("age").mean().alias("avg_age"),
    pl.len().alias("count")
)

# Multiple group keys
df.group_by("city", "department").agg(
    pl.col("salary").sum()
)

# Conditional aggregations
df.group_by("city").agg(
    (pl.col("age") > 30).sum().alias("over_30")
)

For detailed operation patterns, load references/operations.md.

Aggregations and Window Functions

Aggregation Functions

Common aggregations within group_by context:

  • pl.len() - count rows
  • pl.col("x").sum() - sum values
  • pl.col("x").mean() - average
  • pl.col("x").min() / pl.col("x").max() - extremes
  • pl.first() / pl.last() - first/last values
Window Functions with over()

Apply aggregations while preserving row count:

python
# Add group statistics to each row
df.with_columns(
    avg_age_by_city=pl.col("age").mean().over("city"),
    rank_in_city=pl.col("salary").rank().over("city")
)

# Multiple grouping columns
df.with_columns(
    group_avg=pl.col("value").mean().over("category", "region")
)

Mapping strategies:

  • group_to_rows (default): Preserves original row order
  • explode: Faster but groups rows together
  • join: Creates list columns

Data I/O

Supported Formats

Polars supports reading and writing:

  • CSV, Parquet, JSON, Excel
  • Databases (via connectors)
  • Cloud storage (S3, Azure, GCS)
  • Google BigQuery
  • Multiple/partitioned files
Common I/O Operations

CSV:

python
# Eager
df = pl.read_csv("file.csv")
df.write_csv("output.csv")

# Lazy (preferred for large files)
lf = pl.scan_csv("file.csv")
result = lf.filter(...).select(...).collect()

Parquet (recommended for performance):

python
df = pl.read_parquet("file.parquet")
df.write_parquet("output.parquet")

JSON:

python
df = pl.read_json("file.json")
df.write_json("output.json")

For comprehensive I/O documentation, load references/io_guide.md.

Transformations

Joins

Combine DataFrames:

python
# Inner join
df1.join(df2, on="id", how="inner")

# Left join
df1.join(df2, on="id", how="left")

# Join on different column names
df1.join(df2, left_on="user_id", right_on="id")
Concatenation

Stack DataFrames:

python
# Vertical (stack rows)
pl.concat([df1, df2], how="vertical")

# Horizontal (add columns)
pl.concat([df1, df2], how="horizontal")

# Diagonal (union with different schemas)
pl.concat([df1, df2], how="diagonal")
Pivot and Unpivot

Reshape data:

python
# Pivot (wide format)
df.pivot(values="sales", index="date", columns="product")

# Unpivot (long format)
df.unpivot(index="id", on=["col1", "col2"])

For detailed transformation examples, load references/transformations.md.

Pandas Migration

Polars offers significant performance improvements over pandas with a cleaner API. Key differences:

Conceptual Differences
  • No index: Polars uses integer positions only
  • Strict typing: No silent type conversions
  • Lazy evaluation: Available via LazyFrame
  • Parallel by default: Operations parallelized automatically
Show full SKILL.md (221 more words)Show less
Common Operation Mappings
OperationPandasPolars
Select columndf["col"]df.select("col")
Filterdf[df["col"] > 10]df.filter(pl.col("col") > 10)
Add columndf.assign(x=...)df.with_columns(x=...)
Group bydf.groupby("col").agg(...)df.group_by("col").agg(...)
Windowdf.groupby("col").transform(...)df.with_columns(...).over("col")
Key Syntax Patterns

Pandas sequential (slow):

python
df.assign(
    col_a=lambda df_: df_.value * 10,
    col_b=lambda df_: df_.value * 100
)

Polars parallel (fast):

python
df.with_columns(
    col_a=pl.col("value") * 10,
    col_b=pl.col("value") * 100,
)

For comprehensive migration guide, load references/pandas_migration.md.

Best Practices

Performance Optimization
  1. Use lazy evaluation for large datasets:

    python
    lf = pl.scan_csv("large.csv")  # Don't use read_csv
    result = lf.filter(...).select(...).collect()
  2. Avoid Python functions in hot paths:

    • Stay within expression API for parallelization
    • Use .map_elements() only when necessary
    • Prefer native Polars operations
  3. Use streaming for very large data:

    python
    lf.collect(streaming=True)
  4. Select only needed columns early:

    python
    # Good: Select columns early
    lf.select("col1", "col2").filter(...)
    
    # Bad: Filter on all columns first
    lf.filter(...).select("col1", "col2")
  5. Use appropriate data types:

    • Categorical for low-cardinality strings
    • Appropriate integer sizes (i32 vs i64)
    • Date types for temporal data
Expression Patterns

Conditional operations:

python
pl.when(condition).then(value).otherwise(other_value)

Column operations across multiple columns:

python
df.select(pl.col("^.*_value$") * 2)  # Regex pattern

Null handling:

python
pl.col("x").fill_null(0)
pl.col("x").is_null()
pl.col("x").drop_nulls()

For additional best practices and patterns, load references/best_practices.md.

Resources

This skill includes comprehensive reference documentation:

references/
  • core_concepts.md - Detailed explanations of expressions, lazy evaluation, and type system
  • operations.md - Comprehensive guide to all common operations with examples
  • pandas_migration.md - Complete migration guide from pandas to Polars
  • io_guide.md - Data I/O operations for all supported formats
  • transformations.md - Joins, concatenation, pivots, and reshaping operations
  • best_practices.md - Performance optimization tips and common patterns

Load these references as needed when users require detailed information about specific topics.

© davila7, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in cli-tool/components/skills/scientific/polars of davila7/claude-code-templates.

  • SKILL.md
  • references/best_practices.md
  • references/core_concepts.md
  • references/io_guide.md
  • references/operations.md
  • references/pandas_migration.md
  • references/transformations.md

Open the folder on GitHubat commit 46b4d8b

Used in 14 other repositories

We found 26 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 14 other GitHub owners. This page covers the copy in davila7/claude-code-templates, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Polars next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Polars compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Polars this skilldavila7/claude-code-templates32k14 repos~2.3kAutomated safety check: PassMIT
DataframelyQuantco/dataframely619—~2.4kAutomated safety check: PassBSD-3-Clause
Hybrid-Engine Data Analysiscode-yeongyu/oh-my-openagent70k—~1.4kAutomated safety check: PassCustom licence
Optimuskgmims-harvard/OptimusKG146—~1.9kAutomated safety check: PassMIT
Hypothesisanam-org/metaxy124—~1.7kAutomated safety check: PassApache-2.0
Narwhalsanam-org/metaxy124—~3.3kAutomated safety check: PassApache-2.0

Similar skills

  • Dataframely

    Quantco/dataframely

    Best practices for polars data processing with dataframely. An agent skill from Quantco/dataframely.

    619 GitHub stars~2.4k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Hybrid-Engine Data Analysis

    code-yeongyu/oh-my-openagent

    Analyzes CSV, Parquet and JSON data with DuckDB, Polars, numpy and matplotlib, preferring a persistent kernel over repeated one-shot processes.

    70k GitHub stars~1.4k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Optimuskg

    mims-harvard/OptimusKG

    Guide for using OptimusKG, the biomedical knowledge graph, through the optimuskg Python client.

    146 GitHub stars~1.9k tokensUpdated 18 days ago
    Data & AnalyticsAuto-check passed
  • Hypothesis

    anam-org/metaxy

    Use Hypothesis for property-based testing to automatically generate comprehensive test cases, find edge cases, and write more robust tests with minimal example shrinking.

    124 GitHub stars~1.7k tokensUpdated 9 days ago
    Data & AnalyticsAuto-check passed
  • Narwhals

    anam-org/metaxy

    Effectively use Narwhals to write dataframe-agnostic code that works seamlessly across multiple Python dataframe libraries.

    124 GitHub stars~3.3k tokensUpdated 9 days ago
    Data & AnalyticsAuto-check passed
  • Polars Bio

    ClawBio/ClawBio

    Fast genomic interval operations (overlap, nearest, merge, coverage, cluster, complement, subtract, count-overlaps), multi-format bioinformatics I/O, DataFusion SQL, and pileup on Polars DataFrames…

    1.2k GitHub stars~3.4k tokensUpdated yesterday
    Data & AnalyticsAuto-check passed

More from davila7/claude-code-templates

All 478 skills in this repo
  • Perplexity Web Search

    davila7/claude-code-templates

    Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.

    32k GitHub starsUsed in 11 repos~3.5k tokens
    Auto-check: notes
  • Neuropixels Data Analysis

    davila7/claude-code-templates

    Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.

    32k GitHub starsUsed in 9 repos~2.8k tokens
    Auto-check passed
  • Scientific Venue Templates

    davila7/claude-code-templates

    Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.

    32k GitHub starsUsed in 9 repos~5.1k tokens
    Auto-check: notes
  • Brand Voice Content Creator

    davila7/claude-code-templates

    Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.

    32k GitHub starsUsed in 3 repos~1.9k tokens
    Auto-check passed
  • CAPA Officer

    davila7/claude-code-templates

    Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.

    32k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Fda Consultant Specialist

    davila7/claude-code-templates

    Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.

    32k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed

Works with

Questions about Polars

What does Polars do?

Fast DataFrame library (Apache Arrow). An agent skill from davila7/claude-code-templates. Polars is an agent skill from davila7/claude-code-templates. Fast DataFrame library (Apache Arrow).

When should I use Polars?

Polars fits situations like: tasks that involve DataFrames.

How do I install Polars in Claude Code?

Run `npx skills add davila7/claude-code-templates --skill polars -a claude-code`. Or copy the skill folder (cli-tool/components/skills/scientific/polars in davila7/claude-code-templates) into .claude/skills/polars in your project. Claude Code loads it when a task matches its description.

How do I install Polars in Codex?

Run `npx skills add davila7/claude-code-templates --skill polars -a codex`. Or copy the skill folder (cli-tool/components/skills/scientific/polars in davila7/claude-code-templates) into .agents/skills/polars in your project. Codex loads it when a task matches its description.

Can I use Polars in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davila7/claude-code-templates --skill polars -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/polars, .gemini/skills/polars, .github/skills/polars and .opencode/skills/polars in your project.

What does Polars need to run?

SKILL.md names no scripts, command-line tools or credentials: Polars is instructions for the agent only. Our summary lists: Python 3.

Does Polars access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Polars safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Polars use?

Polars is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Polars use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 17k tokens, read only when the agent opens those files.

What are the alternatives to Polars?

Skills that share tags, products or a category with Polars: Dataframely (Quantco/dataframely, 619 stars), Hybrid-Engine Data Analysis (code-yeongyu/oh-my-openagent, 70k stars), Optimuskg (mims-harvard/OptimusKG, 146 stars) and Hypothesis (anam-org/metaxy, 124 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Polars?

davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,483 GitHub stars. The repository holds 478 skills in this directory. The repository was last updated on October 9, 2026.

Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.