Tool này là gì?
Code Interpreter (hiện đổi tên thành "Advanced Data Analysis" trong ChatGPT) là một tool feature của OpenAI — cho phép ChatGPT viết Python code và chạy trong sandbox isolated. Bạn upload file (CSV, Excel, PDF, image, ZIP), ChatGPT phân tích, transform, plot ra biểu đồ — không cần biết Python.
Định vị: "Excel + Python intern" — task nào trên Excel mà bạn không biết làm hoặc tốn 2h, Code Interpreter làm trong 2 phút. Đặc biệt mạnh cho PM cần phân tích data nhanh mà không có analyst.
Tương đương trên các platform khác: Claude có "Analysis" tool tương tự, Gemini có "Code Execution". Khái niệm "code interpreter" giờ là pattern chuẩn.
Khi nào nên dùng
- Phân tích file CSV/Excel: upload data 100K row, hỏi "compute retention by cohort + plot heatmap" — output cell visual ngay.
- Convert file format: JSON ↔ CSV ↔ Excel ↔ PDF table extract — 1 prompt xong.
- Clean data nhanh: "Remove duplicate, normalize phone format VN, parse address" — Python pandas magic.
- Statistical test: "Chạy t-test, chi-square cho A/B test data" — output có p-value + interpretation.
- Visualize quick: hỏi "plot revenue 12 tháng + trend line" — chart đẹp matplotlib trong 5 giây.
- OCR + extract: upload screenshot, "extract table thành CSV" — work tốt cho receipt, invoice.
Khi nào KHÔNG nên dùng
- Data confidential — upload vào ChatGPT public có rủi ro (trừ khi dùng Enterprise/Team).
- Data cực lớn (1GB+) — sandbox memory limit, sẽ crash. Dùng BigQuery + SQL.
- Pipeline production lặp lại — viết Python local + cron rẻ và stable hơn.
- Phân tích cần domain expertise sâu (clinical trial, financial audit) — AI có thể miss nuance, cần specialist verify.
Workflow tiêu biểu
flowchart LR
A[Upload file CSV/Excel] --> B[Mô tả task
'compute retention']
B --> C[ChatGPT viết Python]
C --> D[Chạy code trong sandbox]
D --> E{Output đúng?}
E -->|Lỗi| F[ChatGPT tự debug
iterate]
E -->|OK| G[Download
output file + chart]
F --> D
Pattern: thường mất 2–3 iteration để output đẹp. Lần đầu AI thường compute thô — mình prompt thêm "make chart more visual, color by segment, add data label" — đến lần 3 chart xài được luôn cho deck.
Prompt mẫu
(Upload file users_events.csv)
Compute D-7 và D-30 retention cho cohort signup theo tuần
trong 6 tháng qua.
Steps:
1. Parse csv, identify cohort_week from signup_date
2. Cho mỗi cohort, tính % user có event trong day 7 và day 30
3. Plot heatmap: x=days_since_signup, y=cohort_week,
color=retention%
4. Add label số % trong cell
5. Insight: cohort nào perform tốt nhất / tệ nhất + hypothesis
Export PNG chart + CSV với retention numbers.
(Upload file revenue.xlsx có 12 tab)
Consolidate 12 tab thành 1 master sheet:
- Mỗi row: month, product, revenue, units_sold
- Add cột yoy_growth_% (so cùng tháng năm trước)
- Highlight row có YoY < -10% (giảm mạnh)
- Plot line chart revenue 12 tháng, breakdown by product
- Output: file consolidated.xlsx với formatting
Bonus: gợi ý 3 product cần review chiến lược.
Mẹo nâng cao
Kết hợp với công cụ khác
flowchart LR
A[Mixpanel / BigQuery] -->|export CSV| B[Code Interpreter
analyze + plot]
B --> C[Insight + chart]
C --> D[Claude
viết narrative cho exec]
D --> E[Gamma
convert deck]
Code Interpreter là "data layer" — input file, output insight. Claude lấy insight viết câu chuyện cho exec, Gamma convert thành slide. Pipeline classic cho PM-led data review.
So với alternatives
| So với | Mạnh hơn ở | Yếu hơn ở |
|---|---|---|
| Claude Analysis | Tích hợp với ChatGPT GPT Store, share GPT custom dễ hơn | Claude Analysis có sandbox JS thuần — không lo Python dependency conflict |
| Excel + Copilot | Reasoning sâu hơn, plot đẹp hơn nhiều, transform phức tạp dễ hơn | Excel quen thuộc, không cần upload file lên cloud |
| Jupyter Notebook | Zero setup, không cần biết Python, AI tự viết | Jupyter cho power user — reproducibility, version control tốt hơn |
Tài nguyên thêm
- Official: chatgpt.com (bật "Advanced Data Analysis" trong tools)
- Cheat sheet: bài "21 use cases for ChatGPT Code Interpreter" trên Pinecone blog.
- Best-practice: video "Replace your data analyst with Code Interpreter" trên YouTube Lex Fridman clips.