Pandas Assistant
CautionOptimizes Python pandas workflows by writing efficient DataFrame operations, fixing common performance pitfalls, and converting between pandas, polars, and SQL.
Install
Claude Code
Copy the SKILL.md file to your project's .claude/skills/ directory About This Skill
Pandas Assistant optimizes your Python data analysis workflows. It rewrites slow pandas code into efficient vectorized operations, fixes common anti-patterns, and helps you choose between pandas, polars, and SQL for different scale requirements.
How It Works
- Code review — Identifies pandas anti-patterns: iterrows(), apply() with lambdas, string concatenation in loops, repeated DataFrame copies
- Vectorization — Rewrites iterative code to use built-in pandas/numpy vectorized operations
- Memory optimization — Downcasts numeric types, converts strings to categoricals, uses sparse types where appropriate
- API modernization — Updates deprecated pandas APIs and adopts Copy-on-Write mode for pandas 2.x
- Alternative suggestion — Recommends polars or DuckDB when pandas hits performance ceilings
Best For
- Speeding up slow Jupyter notebook analyses
- Refactoring pandas code from iterative to vectorized style
- Reducing memory footprint for large datasets
- Migrating pandas codebases to polars for performance
Performance Guidelines
Typical speedups: 10-100x from iterrows() to vectorized, 5-10x from apply() to vectorized, 50-80% memory reduction from dtype optimization. For DataFrames over 10M rows, recommends polars or DuckDB.
Use Cases
- Rewrite iterative pandas code to vectorized operations
- Optimize memory usage with proper dtypes and categorical columns
- Convert complex pandas pipelines to polars for speed
- Build multi-step data analysis workflows with method chaining
Pros & Cons
Pros
- + Identifies and fixes the most common pandas performance killers
- + Provides concrete speedup estimates for each optimization
- + Covers migration path from pandas to polars
- + Memory optimization techniques for large-scale analysis
Cons
- - Cannot profile actual execution times without running code
- - Some domain-specific operations resist vectorization
Related AI Tools
GitHub Copilot
Freemium
AI pair programmer that suggests code in real time across your IDE
- Real-time code completions across 30+ languages
- Copilot Chat for natural language code Q&A
- Pull request description and summary generation
Cursor
Freemium
AI-native code editor with deep multi-model integration and agentic coding
- AI-native Cmd+K inline editing and generation
- Composer Agent for autonomous multi-file changes
- Full codebase indexing and context awareness
Related Skills
CSV Transformer
CautionTransforms, cleans, and converts data between CSV, JSON, Excel, and other tabular formats with column mapping, type casting, and validation.
Visualization Builder
CautionGenerates data visualizations, charts, and dashboards using Python (matplotlib, plotly, seaborn), JavaScript (D3, Chart.js), and BI tool configurations.
SQL Optimizer
CautionAnalyzes SQL queries for performance issues, rewrites slow queries, recommends index strategies, and explains execution plans across PostgreSQL, MySQL, and SQLite.
Stay Updated on Agent Skills
Get weekly curated skills + safety alerts
每周精选 Skills + 安全预警