Trainer’s Handbook: Python → Pandas

20 hours • 5 weeks × 4 hrs/week • 1 hr/day — Core & intermediate Python leading into practical data analytics with pandas.

Approach: 95% hands‑on Audience: Basic Python → Intermediate + pandas Environment: Python 3.10+, VS Code, venv

Week 1 · Core Python Foundations

Solid mental model of data types, collections, and functions.

Outcome: confidently using lists/tuples/sets/dictsArtifact: small utilities
Day 1 Intro & Types
  • Topics: variables, numbers, strings, mutability, REPL habits.
  • Hands‑on: build a simple profile object and formatted output.
  • Checkpoint: run script via terminal & debug once in VS Code.
Day 2 Lists & Tuples
  • Topics: index, slice, append/extend; tuple packing/unpacking.
  • Hands‑on: slice last 5 transactions; reverse; compute top‑N.
  • Checkpoint: correct use of negative indices in slicing.
Day 3 Sets & Dicts
  • Topics: uniqueness, set ops; dict CRUD, lookups, iteration.
  • Hands‑on: de‑duplicate emails; build a frequency table.
  • Checkpoint: frequency table exported for review.
Day 4 Functions & Lambdas
  • Topics: function design, parameters, lambdas, purity.
  • Hands‑on: reusable normalizers; quick lambdas for small calcs.
  • Checkpoint: one reusable function + one lambda use.

Week 2 · Control Flow, Files, Datetime, Comprehensions

Program structure, persistence, time handling, and idioms.

Outcome: robust scriptsArtifact: validated CSV outputs
Day 5 Control Flow & Exceptions
  • Topics: branches, loops, enumerate/zip, try/except/finally.
  • Hands‑on: validate CSV rows; count & log bad records.
  • Checkpoint: specific exception types are caught & reported.
Day 6 File I/O & Paths
  • Topics: text/CSV read & write; context managers; pathlib.
  • Hands‑on: filter orders and write a clean file.
  • Checkpoint: correct use of with and Path.
Day 7 Datetime Essentials
  • Topics: parse/format, timedelta math, time differences.
  • Hands‑on: compute due dates; format outputs.
  • Checkpoint: reliable string ↔ datetime conversions.
Day 8 Comprehensions & Functional Tools
  • Topics: list/dict/set comps; map/filter/sorted; any/all.
  • Hands‑on: clean & filter product names; custom sort key.
  • Checkpoint: a multi‑line loop rewritten as a clear comprehension.

Week 3 · Intermediate Python Patterns

Real‑world development techniques and tooling.

Outcome: production‑ready patternsArtifact: utilities + tests
Day 9 Error Handling & Debugging
  • Topics: intentional failure cases, error taxonomies, debugging flows.
  • Hands‑on: break scripts on purpose, catch/repair, document root causes.
  • Checkpoint: issue with cause & fix recorded.
Day 10 itertools & collections
  • Topics: grouping, counting, default dicts, simple pipelines.
  • Hands‑on: summarize orders by customer; top SKUs via Counter.
  • Checkpoint: grouped summary from unsorted rows.
Day 11 Virtual Environments & Package Management
  • Topics: venvs, dependency pinning, reproducibility basics.
  • Hands‑on: create a venv, install deps, freeze requirements.
  • Checkpoint: isolated environment with working deps.
Day 12 Modules & Testing
  • Topics: project layout, modules, test discovery & assertions.
  • Hands‑on: author utils + tests; run green suite.
  • Checkpoint: functions covered by unit tests.

Week 4 · Practical Data Tasks

Everyday developer data wrangling.

Outcome: robust data pipelinesArtifact: CLI script + outputs
Day 13 JSON & CSV at Scale
  • Topics: robust parsing, schema checks, clean writes.
  • Hands‑on: merge JSON config with CSV orders; validate.
  • Checkpoint: separate schema vs content error reporting.
Day 14 Simple HTTP & Parsing
  • Topics: basic fetches, rate‑limit concepts, retry strategies.
  • Hands‑on: fetch a small JSON feed; parse; persist.
  • Checkpoint: HTTP errors handled & logged.
Day 15 Regex, Logging, Performance
  • Topics: extracting patterns; structured logs; timing & profiling.
  • Hands‑on: extract IDs from messy text; compare two approaches.
  • Checkpoint: brief perf note with before/after timings.
Day 16 Mini‑Project (Python Only)
  • Activity: ingest CSVs, validate, enrich with a JSON lookup, summarize, write clean outputs.
  • Deliverables: CLI usage, logs, summary CSV.

Week 5 · Data Analytics with pandas

Read → transform → aggregate → apply → write.

Outcome: end‑to‑end pandas workflowArtifact: analytics report
Day 17 Read & Inspect
  • Topics: reading CSVs, parsing dates, dtypes, basic exploration.
  • Hands‑on: load orders; parse order_date; inspect nulls & stats.
  • Checkpoint: correct dtypes confirmed.
Day 18 Transform & Aggregate
  • Topics: tidy transforms; groupby + aggregate; top‑N patterns.
  • Hands‑on: revenue by day/product/customer; top products.
  • Checkpoint: tidy aggregated dataframe produced.
Day 19 Apply & Custom Functions
  • Topics: apply vs vectorization; conditional columns; simple lambdas.
  • Hands‑on: segment customers; score product popularity.
  • Checkpoint: explain when to avoid apply for performance.
Day 20 Write & Capstone
  • Topics: write CSV/Parquet/Excel; format selection trade‑offs.
  • Hands‑on (Capstone): read → clean → aggregate → apply → write final report; short demo.
  • Checkpoint: reproducible script/notebook; outputs verified.

Datasets & Assets

  • orders.csv — order_id, customer_id, product, quantity, price, order_date
  • customers.csv — customer_id, name, city, segment
  • products.csv — product, category
  • config.json — small lookup (e.g., city → region)

Assessment & Rubric

Pass

  • Idiomatic use of collections; clean functions & lambdas.
  • Correct datetime parsing/formatting; safe file handling.
  • Effective error handling & debugging; venv & dependency hygiene.
  • In pandas: read with correct dtypes; aggregate with groupby; apply judiciously; write to CSV/Parquet.
  • Capstone runs end‑to‑end with correct outputs.

Stretch

  • Prefer vectorization to apply where feasible.
  • Project layout with tests and simple CLI.
  • Optional Excel export with styling; small visualization.

Trainer Logistics

  • Environment: Python 3.10+ (or 3.12), VS Code, virtual environments.
  • Week 5 packages: pandas, pyarrow (Parquet), openpyxl (Excel), optional matplotlib.
  • Share a starter pack: datasets, skeleton folders, requirements.
  • Timeboxing: ~95% hands‑on labs, ~5% explanations per hour.
Jump to pandas Week