pandas
Skill15 starsChanged 44 days agoMITView on GitHub
Expert pandas assistance covering DataFrames, indexing, grouping, merging, time series, and vectorized transformations. Use when cleaning, transforming, and analyzing tabular datasets in Python.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
- ZeroTokenClaw/agents-skillstheir own version, first seen Sep 21, 2026
- kandada/aacodetheir own version, first seen Jul 22, 2026
- watsonfreeman6-ai/dejavu-test-p1-pandastheir own version, first seen Jun 16, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- kandada/aacode★ 134same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- ZeroTokenClaw/agents-skills★ 1same name
- watsonfreeman6-ai/dejavu-test-p1-pandas★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- service-meshSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 116
Use readable method chaining pipelines:
- Very specific: line 136
Use method chaining (.pipe(), .assign(), .query()) for clear, readable, and reproducible data workflows.
- Very specific: line 137
Use .loc[row_indexer, col_indexer] for assignments to prevent SettingWithCopyWarning.
- Very specific: line 143
Use inplace=True; it is deprecated across modern Pandas methods.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pandas
Pandas provides expressive, flexible data structures for tabular data manipulation and analysis in Python, featuring optimized Copy-on-Write (CoW) memory management.
When to Use
- In-Memory Tabular Data Manipulation: Cleaning, transforming, merging, and reshaping tabular business data.
- Time-Series Analysis & Resampling: Date-range indexing, rolling window calculations, and financial resampling.
- Modern PyArrow Backend (Pandas 2.0+): Leveraging Arrow string types for 2x-5x memory savings and instant parsing.
- Exploratory Data Prep & Feature Engineering: Computing group statistics, one-hot encodings, and pivot tables.
Quick Start
import pandas as pd
# Load CSV and compute group summaries
df = pd.DataFrame({
'category': ['Tech', 'Health', 'Tech', 'Finance', 'Health'],
'revenue': [1200, 800, 1500, 2200, 950],
'units': [12, 8, 15, 20, 9]
})
summary = df.groupby('category').agg(
total_rev=('revenue', 'sum'),
avg_price=('revenue', lambda x: (x / df.loc[x.index, 'units']).mean())
).reset_index()
print(summary)Core Concepts
Method Chaining with Modern PyArrow Backend
Clean, functional data transformation pipelines without intermediate variables:
import pandas as pd
import numpy as np
# Load dataset using high-performance PyArrow backend
df = pd.read_csv(
'orders.csv',
dtype_backend='pyarrow',
parse_dates=['order_date']
)
# Declarative pipeline using method chaining
kpi_summary = (
df
.query('status == "delivered" and total_amount > 0')
.assign(
margin_usd=lambda x: x['total_amount'] * 0.22,
order_month=lambda x: x['order_date'].dt.to_period('M')
)
.groupby(['order_month', 'region'])
.agg(
total_revenue=('total_amount', 'sum'),
total_margin=('margin_usd', 'sum'),
avg_order_value=('total_amount', 'mean'),
order_count=('order_id', 'count')
)
.reset_index()
.sort_values(by='total_revenue', ascending=False)
)
print(kpi_summary.head(10))Time-Series Resampling & Rolling Windows
Computing moving averages and periodic intervals:
# Create time-indexed financial series
dates = pd.date_range(start='2026-01-01', periods=100, freq='D')
stock_prices = pd.Series(np.random.normal(loc=150, scale=5, size=100), index=dates)
# Rolling 7-day moving average and 30-day volatility
rolling_metrics = pd.DataFrame({
'price': stock_prices,
'ma_7d': stock_prices.rolling(window=7, min_periods=1).mean(),
'volatility_30d': stock_prices.rolling(window=30, min_periods=1).std()
})
# Weekly resampled summary
weekly_summary = stock_prices.resample('W').agg(['first', 'max', 'min', 'last'])
print(weekly_summary.head())Safe Data Mutation Avoiding SettingWithCopyWarning
Modifying slices explicitly:
# Anti-pattern: df[df['age'] > 18]['status'] = 'adult' # SettingWithCopyWarning!
# Idiomatic Pattern: Use .loc directly or .copy()
adults_df = df.loc[df['age'] > 18].copy()
adults_df['status'] = 'adult'Common Patterns
Method Chaining with Assign and Query
Problem: Creating dozens of temporary intermediate DataFrame variables clutters script memory.
Solution: Use readable method chaining pipelines:
clean_df = (
pd.read_csv("sales.csv")
.dropna(subset=["customer_id"])
.query("amount > 0 and status == 'COMPLETED'")
.assign(
amount_usd=lambda x: x["amount"] * x["exchange_rate"],
order_month=lambda x: pd.to_datetime(x["order_date"]).dt.to_period("M")
)
.sort_values("amount_usd", ascending=False)
)Best Practices
Do:
- Target Pandas 2.2+ with
dtype_backend="pyarrow"to eliminate string object overhead and boost performance. - Use method chaining (
.pipe(),.assign(),.query()) for clear, readable, and reproducible data workflows. - Use
.loc[row_indexer, col_indexer]for assignments to preventSettingWithCopyWarning. - Downcast integer and float types (
float32,int16) or use categorical types to slash memory on large tables.
Don't:
- Iterate over DataFrame rows using
iterrows()oritertuples()if vectorized operations can do the work. - Use
inplace=True; it is deprecated across modern Pandas methods. - Concatenate DataFrames inside a loop; collect records into a list and call
pd.concat(list_of_dfs)once.
Troubleshooting
| Error | Cause | Solution |
SettingWithCopyWarning | Modifying a slice of a DataFrame rather than an explicit copy. | Use .loc[row_indexer, col_indexer] = value or call .copy(). |
KeyError: '...' | Column name does not exist, or column names have leading/trailing whitespace. | Strip column names: df.columns = df.columns.str.strip(). |
DtypeWarning: Columns (...) have mixed types | Large CSV contains inconsistent data types across chunks. | Specify explicit dtype={'col_name': str} in pd.read_csv(). |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

