Data Visualization with an Agent · Challenge 03 · 中文版

Challenge 03: Three charts and a summary

Checkpoint l0310 ptsgated by test suiteAny coding agent + matplotlib

Implement the contract in starter/charts.py — Agg before pyplot, parsed dates, real PNG bytes.

Doing this with your agent? One sentence starts the whole course:

Read https://flypython.com/skills/flypython/SKILL.md and start the FlyPython course `da-visualization`.

Challenge 03: Three charts and a summary

Gate: objective — starter suite · Points: 10

Implement the contract in starter/charts.py. Notes for driving the agent:

  • matplotlib.use("Agg") must run before importing pyplot, or the script dies on machines with no display.
  • groupby("date") on unparsed strings sorts lexically — parse dates first.
  • Tests check PNG magic bytes: a file that is not a real PNG fails.

Checkpoint: python verify.py starter exits 0. Claim code via python verify.py.

Hints

Stuck? Open one at a time.

Hint 1 — What this checkpoint tests

python verify.py starterload_sales, summary, the three chart functions, and main, all green.

Hint 2 — Agg before pyplot

matplotlib.use('Agg') must run before importing pyplot or the script dies on display-less machines. And parse date first — groupby on unparsed strings sorts lexically.

Hint 3 — Files must be real PNGs

The suite checks magic bytes, not that a file exists — write with savefig to the out/ paths the contract names, and emit summary.json UTF-8 indent 2 with a trailing newline.

Submit

Done? Record it.

The 8-character code verify.py progress printed for this checkpoint — from the browser, or straight from your agent.

Youbrowser

Submit the claim code

Your agentauto-submit

Let the agent solve and submit

Hand it this checkpoint (copy button on hover) — it solves, verifies, and submits on its own:

Work on the FlyPython challenge "Data Visualization with an Agent" (course id course-da-visualization), checkpoint l03.
Machine-readable brief: https://flypython.com/api/challenges/da-visualization
Open the course folder and read TASK.md first — it is the contract.
Rules: smallest change, no new dependencies, never edit tests/ or solution/.
Check with python verify.py until its gates pass, then report each claim code to me.
Target: solve only checkpoint l03, and submit it as soon as it passes.

With a token from your agent page (env FLYPYTHON_TOKEN), it records the result directly:

curl -X POST https://flypython.com/api/claims \
  -H "Authorization: Bearer $FLYPYTHON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"claims":[{"course":"da-visualization","checkpoint":"l03","code":"<8-char code>"}]}'

Or install the full FlyPython agent skill once and skip the paste.

Files

The starter and verifier

Solving runs on your machine — your agent fetches the course files itself via /api/challenges/da-visualization/files; you download nothing by hand. Prefer reading the source? Browse the folder on GitHub ↗