Skip to content
Back to skills

Python Data Analyst

ASecurity

Implement or review analysis code in Python with pandas, NumPy or Polars, in scripts or Jupyter notebooks. Use for data cleaning, reshaping, merges, groupby aggregations, feature engineering, type and datetime handling, plotting with Matplotlib or Plotly, making a notebook reproducible, fixing SettingWithCopy or chained-assignment bugs, decimal-safe money calculations, memory problems with large files, and writing pytest checks for transformation logic.

  • 19 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 29, 2026
ai-agentspythongosqlapi

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add khoavd18/skills --skill python-data-analyst --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Data Analyst?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Data Analyst
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/khoavd18-python-data-analyst/badge)](https://www.skillsdirectory.com/skills/khoavd18-python-data-analyst)

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

Download with Pro
SKILL.md
---
name: python-data-analyst
description: Implement or review analysis code in Python with pandas, NumPy or Polars, in scripts or Jupyter notebooks. Use for data cleaning, reshaping, merges, groupby aggregations, feature engineering, type and datetime handling, plotting with Matplotlib or Plotly, making a notebook reproducible, fixing SettingWithCopy or chained-assignment bugs, decimal-safe money calculations, memory problems with large files, and writing pytest checks for transformation logic.
---

# Python Data Analyst

Reproducible, explicit, tested pandas/NumPy work. Follows the project's existing package and notebook conventions. Do not install a new library without stating why.

## Inputs

- The dataset(s), the analytical question, and the expected output (table, chart, file) with its grain.
- The environment: Python and library versions (`pandas.__version__`). pandas ≥ 3.0 enables Copy-on-Write by default, so chained assignment never modifies the original.

## Procedure

1. **Inspect** dtypes, shape and keys (use **data-profiling-engineer** for unfamiliar data).
2. **Define the contract** of each function or step: input columns and grain → output columns and grain.
3. **Preserve raw data**. Load into `raw`, derive new frames, and never write over source files.
4. **Write explicit transformations**: method chains or small pure functions. Use `.loc[mask, col] = …` for assignment, and `.copy()` when deriving a frame you will mutate.
5. **Handle invalid values deliberately**. Use `pd.to_numeric(..., errors="coerce")` only together with a count of the values that became NaN, and report it.
6. **Validate merges** with `validate="one_to_one" | "many_to_one"` and `indicator=True`. Assert row counts after every join and filter.
7. **Test invariants** with pytest on small synthetic frames (see [pandas-practices.md](references/pandas-practices.md)).
8. **Reconcile** key totals against the source or an independent calculation.
9. **Make it reproducible**: pinned seeds, relative paths from a config, no hidden notebook state ("Restart & Run All" must pass), and outputs written to a separate directory.
10. **Document** assumptions, dropped or coerced rows, and limitations next to the output.

## Rules

- No `inplace=True` and no chained assignment (`df[a][b] = …`).
- Never coerce silently. Every coercion, fill or drop is counted and reported.
- Use the right dtypes:
  - `datetime64` with an explicit `format=` and time zone;
  - nullable `Int64`/`string`/`boolean` when NULLs matter;
  - `category` for low-cardinality text.
- Money: use `decimal.Decimal`, or integer minor units, when exact cents matter. Round only at presentation, using the business rounding rule.
- Modeling: split data before fitting any scaler, encoder or imputer, and use time-based splits for temporal data, to avoid leakage.
- Stochastic steps use an explicit seed (`np.random.default_rng(42)`, `random_state=42`).
- Prefer vectorized operations over `apply` with a Python lambda or row loops. Use `usecols`, `dtype` and `chunksize`, or push work to SQL, for files that do not fit comfortably in memory.
- Do not print or save sensitive columns in notebook outputs.

## Outputs

Code (script, notebook or module), tests, a short run log (row counts per step, coercion counts, control totals), and the generated outputs.

## Hand-offs

Recurring file loads → **data-pipeline-engineer**. Inference or experiments → **statistics-experimentation**. Chart and report design → **analytics-storytelling**.

Files in this skill

  • SKILL.md3.4 KB
  • references/pandas-practices.md3.4 KB

Attribution

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

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.