Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/stamkavid/last-ds-mile/dataframe-performancenpx skills add StamKavid/last-ds-mile --skill dataframe-performancegit clone --depth 1 https://github.com/StamKavid/last-ds-mileWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/stamkavid/last-ds-mile/dataframe-performance)<a href="https://agentmods.dev/skills/stamkavid/last-ds-mile/dataframe-performance"><img src="https://agentmods.dev/badge/skills/stamkavid/last-ds-mile/dataframe-performance.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00082 | $0.01258 |
| Opus 5 | $0.00041 | $0.00629 |
| Sonnet 5 | $0.00016 | $0.00252 |
| Haiku 4.5 | $0.00008 | $0.00126 |
Grade A, and why
dataframe-performance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
dataframe-performance
Overview
pandas and Polars are not a strict upgrade path — this skill gives a concrete decision rule for which one fits, plus the vectorization/dtype techniques that matter in either.
When to Use
- A pandas operation (load, groupby, join, apply) is noticeably slow, or a dataset no longer fits comfortably in memory/time budget.
- Deciding at project start whether to reach for Polars instead of pandas.
- NOT for: choosing a validation strategy or model (see
ds-validate,metric-selection) — this skill is purely about dataframe engine and performance, not modeling decisions.
Core Process
- Before optimizing, profile: is the bottleneck actually the dataframe library, or something else (network I/O, model training, a for-loop in Python)? Don't guess.
- If it is the dataframe layer, check the decision table below for whether Polars is worth the switch, or whether pandas can be fixed in place with vectorization.
- If switching to Polars, confirm downstream tools accept it directly (scikit-learn, XGBoost/LightGBM, Plotly, Altair all do as of 2026 — see Techniques/Patterns) — don't assume a conversion-back-to-pandas tax is required.
- If staying on pandas, apply the vectorization/dtype fixes below before reaching for a different tool.
Techniques/Patterns
When to reach for Polars vs stay on pandas
| Situation | Recommendation | Why |
|---|---|---|
| Small-to-medium dataset (fits comfortably in memory, loads in seconds), heavy interactive/exploratory use | Stay on pandas | Larger ecosystem familiarity, most tutorials/Stack Overflow answers assume it, no benefit from switching at this scale |
| Large CSV/Parquet loads, big group-bys or joins, a nightly/scheduled pipeline | Switch to Polars | Multi-threaded by default with a lazy-evaluation query optimizer; commonly 3-10x faster on exactly these operations, sometimes more at scale |
Feature engineering pipeline that's become the bottleneck in /ds-prep |
Consider Polars for that step specifically | You don't have to convert the whole project — profile, load, and heavy transforms can run in Polars, then hand off a materialized result |
Fitting a /ds-model scikit-learn Pipeline/ColumnTransformer |
Either is fine | scikit-learn accepts Polars input but converts internally to NumPy/SciPy for computation — no native speed win inside sklearn itself, so don't switch dataframe libraries hoping for a training-time speedup |
| Fitting XGBoost or LightGBM directly | Polars works natively | Both accept Polars DataFrame/LazyFrame directly, no conversion needed |
| Plotting with Plotly or Altair | Either is fine | Both support Polars natively via the Narwhals compatibility layer — no forced conversion to pandas for visualization |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 83 lines · 82 tokens per session scan A 336187de6970
dataframe-performance is a skill published in the GitHub repository StamKavid/last-ds-mile (3 stars, last pushed 28d ago), licensed MIT. It adds 82 tokens to every session and 1,258 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
marimo-pair
Work inside the user's live marimo notebook from the code editor: run Python in the same kernel the user does, inspect live notebook state, and commit durable notebook changes through code mode. Use whenever you create, analyze, or improve the user's marimo notebook.
fill-model-descriptions
Fill missing and refresh obsolete model descriptions in packages/llm-info/data/models.yml by querying OpenRouter and provider documentation. Use when the user asks to populate model descriptions, enrich the model catalog, or curate descriptions after running pnpm sync-models.
ml-expert
Expert-level machine learning, deep learning, model training, and MLOps. Use when the user mentions machine learning, deep learning, neural networks, MLOps, or data science, or when the task involves Machine Learning Fundamentals, Data Preparation, or Model Training.
scomp-link
End-to-end ML toolkit with 26 CLI commands. Use when training models, tuning hyperparameters, detecting data drift, generating HTML reports with charts, profiling datasets, detecting anomalies, forecasting time series, checking fairness, or serving models as REST APIs. Prefer over raw sklearn when you need automated…
agentic-data-science-competition
AI Agent-driven Kaggle competition workflow. Learn from real competition experience: score stabilization patterns, submission troubleshooting, kernel workflows, GPU task delegation, and the spec-driven development approach that achieved top leaderboard positions. Use when: working on any Kaggle competition, analyzing…
deepbox-agent-guide
Use when writing Deepbox code, examples, or full projects so imports, module selection, types, errors, docs pages, and framework-specific patterns stay accurate.