pandas-performance
Installation
SKILL.md
pandas - Performance & Memory Management
Standard pandas code is often memory-hungry and slow. This sub-skill provides the techniques to make pandas 10x faster and use 5x less RAM by understanding its internal architecture (BlockManager and Arrow backend).
When to Use
- Your DataFrame is larger than 1GB and causes RAM pressure.
pd.read_csvis taking too long to load data.- Row-wise operations (
apply,iterrows) are creating bottlenecks. - You need to perform complex joins or lookups on millions of rows.
- Preparing data for high-performance ML models.
Reference Documentation
- Official Performance Guide: https://pandas.pydata.org/docs/user_guide/enhancingperf.html
- Scaling to Large Data: https://pandas.pydata.org/docs/user_guide/scale.html
- Search patterns:
df.memory_usage,pd.to_numeric(downcast=...),pd.Categorical,DataFrame.eval()