Topic 3 of 5 · 4 min read
Reading the analysis steps it ran
Goal: Open the analysis steps behind an answer and say which rows were filtered, grouped or dropped to reach the number.
ChatGPT, Claude and Gemini often run small Python programs behind an answer. You do not need to know Python to open them and see which rows were kept, grouped or thrown away.
Check yourself · 1 of 3
In an AI analysis, which kind of line most clearly keeps only some of your rows?
Why it matters
The number in the reply is the end of a chain of steps. The assistant chose to filter some rows, group others and drop empty cells. Each choice can change the answer, and none of them appears in the friendly summary. If you read only the summary, you trust the choices blind. The analysis steps are where they are written down.
Where to find the steps
In ChatGPT, the answer usually has a link or button for the analysis, which shows the code. In Claude, the analysis tool shows its work in an expandable block. In Gemini, code run on a file appears as a code block you can expand. Names and screens change, so look for "analysis", "code" or "show work". If none appears, the number may be a guess; see the previous topic.
What to look for
You are not checking the code is clever. You are looking for a handful of words.
- Filter words. Lines with
==,>,<,isinorquerykeep only some rows. Ask: which rows are left out, and was that what I wanted? A filter onstatus == 1means only paid orders. - Dropping words.
dropnaremoves rows with empty cells.drop_duplicatesremoves repeated rows. Either can delete real data silently. - Grouping words.
groupbysplits rows into groups, andsum,mean,countormedianis what is worked out for each group. Check it is the one you asked for. Ameanis not amedian. - Joining words.
mergeorjoincombines two tables. This is where rows can multiply or vanish (next topic). - Row counts. Look for a printed count before and after each step. If 4,812 rows became 3,950 after one line, ask what that line removed.
Before and after
Before: You see "Average order value: 62.40" and accept it.
After: You open the steps and notice the line that keeps only rows where
amtis greater than 0. You ask: "How many rows did this exclude, and why? Include refunds and show both averages."
The assistant reports 4,812 rows, 311 refunds removed, and the two averages. Now you know what the 62.40 meant.
Ask in plain words
You can also skip reading and ask: "List every filter, drop and group you used, in plain English, with the number of rows before and after each step." Then compare that list with the code.
What goes wrong
- Never opening the steps. Most errors are visible in a few lines.
- Believing the explanation over the code. The text can say "all customers" while the code kept a subset. Trust the code.
- Assuming no code means no problem. If no steps exist, ask for them or recount.
Examples
A quiet filter changes the answer
You asked for the average order value. The steps contain a line that keeps only rows where amt is greater than 0. In plain words: refunds, which are negative amounts, were left out.
You reply: "How many rows did that remove? Give me the average with and without refunds." The assistant answers 311 rows removed, 62.40 without refunds and 58.10 with them.
Asking for a plain-English method list
Instead of reading code, ask: "List every step you used: each filter, each dropped row type, each grouping, and the row count before and after." Compare the list with the steps. If the list says "all customers" and the steps contain a country filter, tell the assistant which one is true.
Key points
- The summary in the reply hides the filters, drops and groupings that produced the number.
- Look for the analysis or code block in ChatGPT, Claude or Gemini and open it.
- Scan for filter words, dropna and drop_duplicates, groupby with its sum, mean or median, and merge or join.
- Ask for the number of rows before and after each step, so any loss is visible.
- When the explanation and the code disagree, the code is what produced the number.
Common mistakes
- Reading only the summary and never opening the analysis steps.
- Skipping the lines that drop empty cells or duplicates because they look like cleanup.
- Trusting the written explanation when the code shows something different.
- Confusing mean and median when the question asked for a typical value.
Check yourself · 2 of 3
The steps behind an answer contain dropna. What does that do?
Check yourself · 3 of 3
You cannot read Python. What is the most practical way to learn what the assistant did to reach a number?
Practice items, not counted towards your mastery.
Start here
- Data analysis with ChatGPT (OpenAI Help Center) (opens in a new tab)DocsFree
How ChatGPT reads uploaded files, runs Python for you and what limits apply to file size and types.
- Create and edit files with Claude (opens in a new tab)DocsFree
How Claude runs code on your files and hands back new files you can download and check.
- Python Data Science Handbook (opens in a new tab)BookFree
A free book that shows what grouping, merging and filtering do, so you can read the steps an assistant ran.