---
name: Python Data Science
description: Turn a data question into a reproducible Python pipeline — clean, join, transform, automate, and (where permitted) scrape — with pandas/NumPy, notebooks, and scheduled jobs, so the number that ends up in a deck is one you can re-run and defend.
audience: analyst · growth marketer · data-curious PM · founder
---

# Python Data Science

## What this is
A method for using Python as the workbench for real data work: ingesting messy sources, cleaning and reshaping them, automating the boring parts, and producing a result that is **reproducible from raw input** rather than hand-massaged in a spreadsheet.

## What this is NOT
- **Not a statistics or ML course** — it is the plumbing that feeds them (see the Statistical Modeling and ML for Business skills). It does not tell you a result is significant or a model is good.
- **Not a licence to scrape anything.** Scraping respects robots.txt, terms of service, rate limits, and personal-data law (GDPR/CCPA). Personal or copyrighted data, and anything behind auth, is routed to legal before collection.
- **Not a substitute for a data engineer** on production pipelines, warehousing, or PII handling at scale.

## When to use
Cleaning a CSV/JSON/API dump; joining sources that don't share a clean key; automating a weekly pull; building a repeatable analysis notebook; one-off collection from a public, permitted source.

## Operating principle
Raw stays raw. Every transform is code, not a manual edit, so the pipeline re-runs end-to-end and the same input always yields the same output. Secrets live in env vars, never in the notebook.

## Capabilities
- **Ingest & clean** — Goal: a tidy, typed dataframe from messy input. Method: pandas read/parse, dtype coercion, null strategy stated (drop/impute/flag), dedup keys named, units normalised. Output: a documented cleaning notebook + the cleaned dataset. Quality bar: rerunning from raw reproduces the output byte-for-byte.
- **Transform & join** — Goal: analysis-ready shape. Method: reshape (pivot/melt), window/group aggregates, fuzzy or keyed joins with match-rate reported, date handling with explicit timezones. Output: the modelled dataframe + a join-quality note. Quality bar: no silent row loss — every join reports matched/unmatched counts.
- **Automate & (permitted) collect** — Goal: hands-off refresh. Method: parameterised script, scheduled job, API pagination + backoff, or polite scraping (robots/ToS checked, rate-limited, cached). Output: a runnable job + a source/permission note. Quality bar: transient failure retries; a blocked source fails loud with the reason, never silently returns partial data.

## A worked example
"Pull our reviews and last quarter's orders and line them up." → Ingest reviews (API) + orders (CSV); clean both; fuzzy-join on order id + email with a 94% match rate reported; the 6% unmatched are kept and flagged, not dropped; the whole thing re-runs on a weekly schedule. The deck cites "reproducible pipeline, last run 2026-07-20," not "I copied it into Sheets."

## Guardrails & escalation
Personal/sensitive/copyrighted data → legal before collection. Production data movement, warehousing, or PII at scale → data engineering. Any conclusion drawn from the data → the Statistical Modeling / ML skills, not this one.

## References
pandas / NumPy documentation; PEP 8; robots.txt (RFC 9309) and site terms of service; GDPR Art. 5–6; CCPA. Verify library APIs against current versions.
