Lesson 398 of 2116
Code Interpreter / Advanced Data Analysis: What It Can And Can't Do
Code Interpreter looks magical and is genuinely useful, but it runs in a sandbox with real limits. Knowing those limits saves hours of stuck-in-a-loop debugging. What is actually happening when ChatGPT runs code Code Interpreter (also known as Advanced Data Analysis) is a Python sandbox running on OpenAI's servers.
Lesson map
What this lesson covers
Learning path
The main moves in order
- 1What is actually happening when ChatGPT runs code
- 2Code Interpreter
- 3sandbox
- 4Python
Concept cluster
Terms to connect while reading
Section 1
What is actually happening when ChatGPT runs code
Code Interpreter (also known as Advanced Data Analysis) is a Python sandbox running on OpenAI's servers. The model writes code, executes it, sees the output, and iterates. You get the equivalent of a junior data analyst with read-only access to the files you upload. The model cannot reach the open internet from inside the sandbox.
Things it does brilliantly
- Cleaning and exploring CSV / Excel data — pivot tables, joins, summary stats.
- Generating charts from a dataset and iterating on them ('make the bars sorted, add labels').
- Converting between file formats — PDF to text, Excel to CSV, image to text via OCR libraries.
- Running statistical tests when you describe the question in plain English.
- Writing and testing one-off Python scripts before you copy them into your own environment.
Things it cannot do
- Reach the public internet from inside the sandbox — no API calls, no scraping.
- Persist files across separate conversations — the sandbox is reset.
- Run very long jobs — there are wall-clock timeouts in the tens of seconds for any single execution.
- Install arbitrary packages — only what is in the pre-installed environment, though the set is large.
- Process huge files — practical limits depend on tier, but assume a few hundred MB ceiling, often less.
Compare the options
| Task | Right tool | Why |
|---|---|---|
| Quick exploratory analysis of a 5MB CSV | Code Interpreter | Fastest path from question to chart |
| Scheduled daily ETL job | Real Python on your infra | Sandbox is interactive only |
| Calling a paid API mid-analysis | Real Python | No outbound network in the sandbox |
| A 10GB log file analysis | Local DuckDB or cloud notebook | Too big for the sandbox |
| One-off chart for a slide deck | Code Interpreter | Iterating with the model is faster than tweaking matplotlib by hand |
Applied exercise
- 1Find a CSV you have been meaning to look at — anything with at least 5 columns and 1000 rows.
- 2Upload it and ask: 'What are the three most surprising things in this data?'
- 3Ask to see the code for the most interesting answer.
- 4Verify one number by hand. Note where the model's framing of a column was off, if it was.
Key terms in this lesson
The big idea: Code Interpreter is a fast scratchpad, not a production runtime. Use it to think with data, then port the logic out.
End-of-lesson quiz
Check what stuck
15 questions · Score saves to your progress.
Tutor
Curious about “Code Interpreter / Advanced Data Analysis: What It Can And Can't Do”?
Ask anything about this lesson. I’ll answer using just what you’re reading — short, friendly, grounded.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Creators · 40 min
ElevenLabs v3 — voice cloning use cases
ElevenLabs v3 clones a voice from seconds of audio. Here is what to build, what to avoid, and how to stay on the right side of consent.
Creators · 9 min
Sora: Video Generation Prompts And Their Limits
Video generation is the most expensive and least controllable AI media. Even when models like Sora are available, getting useful clips is a craft — and the platform reality keeps shifting.
Creators · 10 min
ChatGPT For Research: Connectors And Document Q&A
ChatGPT can now read your Drive, your Notion, your wiki — if you let it. The research workflow that emerges is genuinely new, and so are the trust and access questions.
