Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Pandas Pro

ASecurity

pandas guidance — data wrangling, groupby, merging, time series, performance optimization, and memory management.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
ai-agentspythongosqlapibackendperformance

Works with

api

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill pandas-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pandas Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Pandas Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-pandas-pro/badge)](https://www.skillsdirectory.com/skills/aicodedecode-pandas-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: pandas-pro
description: pandas guidance — data wrangling, groupby, merging, time series, performance optimization, and memory management.
category: development
---

## Overview

pandas is the lingua franca of tabular data in Python: DataFrames for wrangling, groupby for aggregation, merges for combining, and time-series tooling that handles most real-world messiness. It's also easy to write slow, memory-hungry pandas — the difference between fluent and naive usage is often 100x.

This skill covers idiomatic pandas: vectorized operations, the split-apply-combine pattern, correct merging, time-series handling, and the performance/memory practices that keep big DataFrames tractable.

## When to use

- Wrangling and cleaning tabular data.
- Aggregating with groupby.
- Merging/joining DataFrames.
- Working with time series.
- Speeding up slow pandas code.
- Reducing pandas memory usage.

## Core concepts

- **Vectorization.** Operate on whole columns, never loop rows: `df['c'] = df['a'] + df['b']`, not `iterrows()`. Row loops are 100-1000x slower — if you're writing `for` over a DataFrame, there's almost always a vectorized way.
- **Indexing.** `.loc` (labels), `.iloc` (positions), boolean masks — `df.loc[df['x'] > 0, 'y']`. Chained indexing (`df[a][b]`) risks SettingWithCopyWarning; use single `.loc` calls. Copy-on-Write (default in 3.0) changes mutation semantics — know it.
- **groupby (split-apply-combine).** `df.groupby('key').agg(...)` — the core aggregation pattern; `transform` for group-aligned results (z-scores within groups), `apply` as the flexible-but-slow escape hatch. Named aggregations for readable multi-output.
- **Merges and joins.** `merge` (SQL-style: inner/left/right/outer on keys), `join` (index-based), `concat` (stacking). Validate with `validate=` ('one_to_one', 'many_to_one') — catching unexpected duplicates at merge time. Understand merge cardinality before merging.
- **Reshaping.** `pivot`/`pivot_table` (long→wide), `melt` (wide→long), `stack`/`unstack` — tidy data (one observation per row) makes everything downstream easier.
- **Missing data.** `isna`/`notna`, `fillna` (with method/limit awareness — forward-fill across gaps lies), `dropna` (with `subset`/`thresh`), `interpolate` for time series. Missingness is information — understand why values are missing before filling.
- **Dtypes.** `int64`→`int32`, `float64`→`float32`, `object`→`category` for low-cardinality strings, nullable `Int64`/`boolean` for missing-aware integers, `string` dtype. Correct dtypes halve memory and speed operations.
- **Time series.** `DatetimeIndex`, `resample` (downsampling), `asfreq`/`reindex` (regularizing), `rolling`/`ewm` (windows), timezone-aware (`tz_localize`/`tz_convert`) — DST and timezone bugs are perennial; be explicit.
- **String methods.** `.str` accessor (contains, extract, split) — vectorized string ops; regex via `extract` with named groups. Faster than `.apply` with Python string functions.
- **Categorical.** `astype('category')` for repeated strings (statuses, codes) — massive memory savings and faster groupbys; ordered categoricals for meaningful sorting.
- **Method chaining.** `df.pipe(clean).query("x > 0").assign(z=lambda d: d.x * 2)` — readable pipelines without intermediate variables; `assign`/`query` keep chains fluent.
- **Memory.** `memory_usage(deep=True)`, downcasting numerics, categoricals for strings, chunked reading (`chunksize`) for files bigger than RAM, `pyarrow` dtypes/backend for large data.
- **I/O.** `read_csv` with `dtype`, `parse_dates`, `usecols` (read only what you need); Parquet (`read_parquet`) for analytics — faster and typed; `to_parquet` for intermediates instead of CSV.
- **MultiIndex.** Hierarchical indexes for panel data — powerful but complexity-heavy; `reset_index` when simplicity wins. Know `xs` and `loc` with tuples for selection.

## Practical workflow

1. **Profile first.** `df.info()`, `df.memory_usage(deep=True)`, `df.describe()` — know shape, dtypes, and memory before touching anything.
2. **Fix dtypes early.** Downcast numerics, categorize low-cardinality strings, parse dates at read time:
   ```python
   df = pd.read_csv("data.csv", usecols=["id", "ts", "status", "amount"],
                    parse_dates=["ts"],
                    dtype={"status": "category", "amount": "float32"})
   ```
3. **Clean vectorized.** Boolean masks, `.str` methods, `fillna` with intent — no row loops:
   ```python
   clean = (df.dropna(subset=["id"])
              .query("amount >= 0")
              .assign(amount_usd=lambda d: d["amount"] * rate,
                      status=lambda d: d["status"].str.lower().str.strip()))
   ```
4. **Aggregate with groupby.** Named aggregations for clarity; `transform` for within-group features:
   ```python
   summary = df.groupby("customer").agg(
       orders=("id", "count"),
       total=("amount_usd", "sum"),
       avg=("amount_usd", "mean"))
   df["z"] = df.groupby("customer")["amount_usd"].transform(
       lambda s: (s - s.mean()) / s.std())
   ```
5. **Merge carefully.** Check key uniqueness first; use `validate=`; inspect `_merge` indicator for unexpected non-matches:
   ```python
   merged = orders.merge(customers, on="customer_id", how="left",
                         validate="many_to_one", indicator=True)
   ```
6. **Handle time properly.** Timezone-aware indexes, `resample` for aggregation, `rolling` for windows; explicit about gaps vs missing.
7. **Optimize hot paths.** Replace `.apply` with vectorized ops; categoricals for groupby keys; `numba`/`eval` for extreme cases; chunked processing when RAM-bound.
8. **Persist as Parquet.** Intermediates and outputs in Parquet (typed, compressed, fast) — CSV only at system boundaries.

## Common pitfalls

- **Row loops** — `iterrows`/`itertuples` for transforms; vectorize instead (100x+).
- **Chained assignment** — `df[a][b] = v` silently failing; single `.loc` calls.
- **Object dtype everywhere** — strings as objects eating memory; categoricals + proper dtypes.
- **Merging on duplicates** — cartesian explosions; `validate=` and key checks first.
- **Timezone-naive datetimes** — DST bugs; explicit tz handling.
- **Forward-fill across gaps** — `ffill` inventing data; limit-aware filling.
- **`.apply` as default** — Python-level loops in disguise; vectorized alternatives first.
- **Reading whole files** — `usecols`, `dtype`, `chunksize`, Parquet for big data.
- **Ignoring SettingWithCopyWarning** — it signals real bugs; fix the indexing.
- **Groupby-apply slowness** — `apply` where `agg`/`transform` suffice; restructure.
- **CSV for intermediates** — slow, untyped, big; Parquet.
- **Memory blowups** — no dtype attention; profile with `memory_usage(deep=True)`.
- **MultiIndex overuse** — complexity for simple problems; flat + reset_index often wins.

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →