Upload the File, Then Ask One Question at a Time
What it is
A pattern for ChatGPT's data analysis (code interpreter): upload the raw file, ask it to first describe the data, then pose one analytical question per turn.
Why it works
ChatGPT runs real Python on your file, but it can't see the data until it inspects it. Asking it to profile the file first (columns, types, row count, missing values) grounds every later answer in reality instead of assumptions. One question per turn keeps the generated code — and any chart — auditable.
When to use it
Any CSV/Excel/JSON you want summarised, cleaned, joined, or charted. Especially when you don't fully trust the file's shape yet.
When not to use it
Tiny datasets you can eyeball, or anything requiring guaranteed-correct numbers for compliance — always spot-check the generated code, don't treat output as authoritative.
Prompt
Step 1: "Here's the file. Before analysing, load it and show me: columns, dtypes, row count, and any missing values."
Step 2 (one at a time): "Now show monthly revenue as a line chart." → "Which 5 customers drive the most revenue?" → "Export the cleaned table as CSV."Example
For a messy sales export, the profiling step reveals a date column stored as text and 300 blank rows. You fix those first — so every chart afterwards is correct, instead of silently plotting garbage.
Advanced version
Ask ChatGPT to show the code it ran and to state assumptions ('I treated blank amounts as zero'). If a number matters, request the exact filter used so you can reproduce it in your own tools.
Common mistakes
- Asking for a conclusion before the model has inspected the file, so it guesses the schema.
- Stacking five questions in one message, making the generated code impossible to review.
- Trusting the output number without checking the code — the model can misread a column.