Audit a three-claim summary
An AI summarized ticket sales in three sentences. Check each claim for grain, blanks and repeats, and rewrite the summary.
9 min
Free course. Your Maestro, an AI, .
Before you inspect any single category or average in an AI's report, think back to Module 4: what total do you need to establish and reconcile first so you can tell whether rows were dropped or counted twice?
Up to this point, you have diagnosed one calculation flaw at a time. In everyday work, you usually ask a broad question about a table and receive a short paragraph backed by several lines of Glossary word code. When the underlying table has an export repeat or a blank cell, that single data issue can distort multiple sentences at once, while individual lines of code add their own Glossary word mistakes.
A box office team exported an 8-row ticket table called lines and asked an AI to summarize last week's sales. The AI answered in three sentences:
"We sold 8 orders, with an average order of $42.50. Jazz brought in $200 and Poetry $90."
To audit a multi-claim answer systematically, run each claim through the same six checks before you rewrite a single number:
Grain
Check what one row in the table represents versus what the sentence claims to count or average. Identify which column uniquely labels a row (
line_id) and which column groups rows into the unit named in the question (order_id).Divisor
When a claim reports an average, check what
mean()divided by. Averaging the raw table divides by the number of rows; averaging per order requires summing byorder_idfirst and dividing by the count of orders.Denominator
When a claim reports a share or rate, name the exact group in the denominator and check whether filtering or missing values shrank that base.
Blanks and exclusions
Inspect which columns contain
NoneorNaNvalues and how each function treats them. By default,groupby()silently drops rows where the grouping column is blank unless you passdropna=False.Repeats
Check whether the unique row identifier repeats (
duplicated(subset="line_id")). Distinguish duplicate copies of the same record from separate items in the same order that share a price.Reconcile the total
Compare the raw table sum against the deduplicated sum, and verify that every category breakdown adds up to that cleaned total with nothing left out.
Here is how the checklist applies to Claim 1 ("We sold 8 orders"):
- Grain and repeats: Each row in
linesrecords one seat line (line_idL1throughL7) inside a customer order (order_idO1throughO5). OrderO1has two rows (L1andL2, both Jazz at $40), and orderO4has two rows (L5andL6, both Poetry at $30). Because those rows have distinctline_idvalues, they are legitimate separate seats bought on the same order. Meanwhile,line_idL3(in orderO2, Jazz at $60) appears twice in the 8-row export. If you want to verify why L1 and L2 are kept while the second L3 is dropped, ask your Maestro to compare the two columns. - Verdict and cause: False. The AI ran
len(lines), which counted all 8 seat-line rows, including the repeatedL3row, instead of counting distinct orders. - Recomputed number: After deduplicating on
line_idwithlines.drop_duplicates(subset="line_id"), the table holds 7 valid seat lines across 5 distinct orders (clean["order_id"].nunique()).
Fixing Claim 1 in prose leaves the other two sentences broken because their code still ran on the raw lines table:
- Claim 2 ("an average order of $42.50"): Check what
lines["amount"].mean()averaged, what divisor it used, and how the repeatedL3row affected the Glossary word. Then compute the average at the order grain on the deduplicated table. - Claim 3 ("Jazz brought in $200 and Poetry $90"): Check what
lines.groupby("event")["amount"].sum()included and what it dropped. Seat lineL7(orderO5, $50) hasNonein theeventcolumn, which represents unassigned ticket revenue that belongs in your report so the breakdown passes Glossary word against total sales.
Try it
Run the exercise below to inspect the AI's output, remove the repeated line_id, and recompute the order count, the average per order, and the revenue by event (keeping blanks).
Before you write your revised summary below, verify that your numbers agree across both groupings: the sum of your five order totals and the sum of your event breakdown (including the unassigned None row) should both equal clean["amount"].sum().
Try auditing Claims 2 and 3 on your own first. Hints after an attempt are fine, though using a hint records your work on this page as assisted. If you are stuck after your first attempt, ask your Maestro for a hint on the claim you are checking.