Mission 04 / ANALYSIS / REPORTING
Pandas and Data Analytics
Load synthetic CSV data, remove incomplete measurements, group observations, and report the result with Pandas.
Briefing
Clean and group synthetic telemetry
A DataFrame is a labeled table of rows and columns. In this lab, Pyodide loads Pandas in a browser worker and supplies a tiny synthetic CSV file without uploading it.
Load and inspect
`pandas.read_csv` turns CSV text into a DataFrame. Check column names and missing values before making assumptions. A row with an absent temperature is not a valid temperature sample, though it may still contain other useful fields.
Clean with a stated rule
`dropna(subset=[...])` removes rows missing a required measurement. Record the rule in the report so readers know why the row count changed. Avoid silently converting missing values to zero: that invents a measurement.
Group and summarize
`groupby` partitions rows by a key; `size` counts observations in each group. This exercise reports cleaned sample counts by zone. Visualization and notebook export are planned modules; the executable starter uses a compact text summary.
Practical exercise
Run the mission
Load the provided CSV, remove rows without `temperature_c`, group by zone, and print `north:3,south:1`.
Progressive hint
Use `pd.read_csv(StringIO(csv_data))`, `dropna(subset=['temperature_c'])`, and `groupby('zone').size()`.
Need another hint?
Sort the grouped counts by zone before formatting so the output order is stable.
Sample data · synthetic CSV
flight_id,zone,temperature_c,status A-01,north,28,nominal A-02,north,31,review A-03,south,,nominal A-04,north,26,nominal A-05,south,30,review
Run the starter to see observable output. Code is saved in this browser.
Pyodide · Python in WebAssembly · isolated short-lived browser worker
Knowledge check