How to run exploratory data analysis with Claude + Jupyter
When to use: You've got a new dataset and want to poke at it without writing boilerplate cells yourself.
Prerequisites
- Running JupyterLab with token auth — jupyter lab --no-browser; copy the token from the URL
- JUPYTER_URL + JUPYTER_TOKEN env vars — Set to your lab URL and token
Flow
-
Load the notebook and dataUse use_notebook to open analysis.ipynb. Insert a cell that loads ./data/events.parquet into a DataFrame named df.✓ Copied→ Cell executes; df.head() preview returned
-
Iterate on analysisWhat does the distribution of event_type look like? Plot it, show me the image.✓ Copied→ Histogram image rendered in chat
-
Save a clean notebookClean the notebook: delete error cells, add markdown headers, restart-run-all to verify it runs top-to-bottom.✓ Copied→ Notebook that reproduces end-to-end
Outcome: A publishable notebook with narrative, charts, and verified reproducibility.
Pitfalls
- Kernel state drifts from notebook cell order — Use notebook_run-all-cells after edits to catch hidden-state bugs
- Data files aren't visible to the kernel — Kernel's CWD is the notebook's dir, not where you started Jupyter — use absolute paths