Agents · Lesson 04
Pro
~11 min read
Charts + analysis
Code Interpreter: Python without typing Python.
Code Interpreter (sometimes called Advanced Data Analysis) is the ChatGPT mode that runs Python on data you upload. CSV files, Excel sheets, images, even PDFs — it can read, analyze, transform, and chart. For anyone who used to ask their data team for one-off analysis, this is the tool that lets you self-serve.
Workflow 01 CSV → cleaned, analyzed, charted
1
The classic data file workflow
You have a messy CSV. You want clean data, summary stats, and a chart. Code Interpreter does all three in one prompt.
The prompt that works
CSV pipelineHere's our Q1 sales CSV. Please:
1. Clean it: fix any obvious data quality issues (inconsistent date formats, trailing whitespace, currency strings that should be numbers, etc.). Show me what you fixed.
2. Analyze:
- Total revenue, broken out by month
- Top 5 customers by revenue
- Average deal size and median deal size
- Any outliers (very large or very small deals)
3. Chart:
- Bar chart: revenue by month
- Pie chart: revenue share by top 5 customers + 'Other'
- Histogram: distribution of deal sizes
4. Save the cleaned file as 'q1-sales-cleaned.csv' and the charts as separate PNGs.
Best use cases
- Sales or revenue data analysis
- Survey response analysis
- Marketing campaign performance
- Customer churn or retention analysis
Code Interpreter sometimes hallucinates column names — always upload the actual file rather than describing it. And spot-check the cleaned output before trusting downstream analysis.
Time savings: A typical 'CSV → cleaned data + charts' task: 1-2 hours manual → 5 min.
Workflow 02 Format conversion at scale
2
PDF → CSV, Excel → JSON, anything weird → anything useful
Code Interpreter is good at format wrangling because it can write whatever Python it needs. Tables in PDFs, weird Excel layouts, JSON that should be tabular — all solvable.
The prompt that works
Format extractionI have a PDF (attached) with about 20 tables of pricing data — one table per page. Each table has the same column structure: SKU, Description, Price, Available regions.
Extract every row from every table into a single CSV. Use OCR if needed. Skip pages without tables.
Clean the data: normalize regions to a consistent list (US, EU, APAC, LATAM, OTHER). Convert prices to numbers (strip $, commas). Flag any rows where extraction looked uncertain so I can verify.
Output: cleaned CSV + a 'low-confidence-rows.csv' for review.
Best use cases
- PDF table extraction at scale
- Excel reformatting (pivot, unpivot, transpose)
- JSON ↔ CSV conversion
- Legacy file format migration
PDF extraction quality depends on PDF source. Scanned PDFs need OCR which is imperfect — verify a sample of the output, not just trust 'it ran successfully.'
Time savings: Manual table extraction from PDFs: hours → minutes.
Workflow 03 Statistical analysis without statistician
3
A/B test analysis, regression, significance testing
When you have data and a hypothesis, Code Interpreter can run real statistics — not just summary tables.
The prompt that works
A/B test analysisI ran an A/B test on our checkout page. Data file attached: 'ab-test-results.csv' with columns user_id, variant (A/B), converted (0/1), order_value.
Run a proper analysis:
1. Conversion rate by variant (with confidence intervals)
2. Statistical significance test (with p-value and explanation of what it means)
3. Lift in conversion rate (% and absolute)
4. Average order value by variant (for converted users only) with significance test
5. Sample size — is this enough data to draw conclusions? If not, how much more do we need?
6. Plain-English summary: should we ship variant B or not, and why?
Use standard A/B testing methodology (frequentist or Bayesian — pick one and explain). Show your work.
Best use cases
- Experimentation result analysis
- Customer cohort comparison
- Pre/post intervention measurement
- Power analysis for planning experiments
Code Interpreter can do real statistics — but it can also do wrong statistics with the same confidence. Ask it to show the test it chose and why. If you're in a high-stakes decision, get a statistician to verify.
Time savings: A/B test analysis: half a day of work → 10 min with proper checks.
Limits to knowCode Interpreter runs in a sandboxed Python environment with no internet access. It can't fetch new data mid-task. File size limit is around 512MB per file (varies). Sessions reset, so don't expect it to remember work from yesterday's session.
Replace one data request to your team
Think of the last time you asked an analyst or data person for a 'quick analysis.' Take the underlying data, upload it to Code Interpreter, and run the analysis yourself. Notice what works and where you'd still want a human in the loop — that calibration is the skill.
What you can do now
- Upload actual files; don't describe what's in them
- Spot-check cleaned data before trusting downstream analysis
- Ask Code Interpreter to show its work for statistical tests
- Know the sandbox limits (no internet, file size cap)
- Use this for self-service analysis — escalate complex stats to experts
Pro
Up next in ChatGPT Mastery
Lesson 05 · GPT Store — the third-party GPTs worth knowing
The GPT Store has millions of GPTs. 99% are noise. This lesson covers the categories that consistently produce useful GPTs and the ones you should know by name. See the track →