Python notebook
A Jupyter-style Python notebook that runs entirely in your browser (Pyodide) — code and Markdown cells, one shared namespace, pandas tables and matplotlib figures inline, tracebacks, CSV upload, open and download .ipynb files, autosave, share links, and starter notebooks for pandas, plotting, linear algebra, SciPy statistics and simulation.
Added
How to use it
Python 3.12 — real CPython compiled to WebAssembly by Pyodide — in a notebook like Jupyter’s. Cells share one namespace, so a DataFrame built in one cell is there in the next. Nothing is installed on your computer and no server runs your code.
For a quick one-off script (or another language — C, Rust, Lua, SQL…), the language sandbox is simpler. For cleaning a table with SQL, see the data wrangler.
How to use it
Running. ▶ Run on a cell, or Shift+Enter (run and move to the next cell), Ctrl/Cmd+Enter (run
in place) or Alt+Enter (run and add a cell below). ▶▶ Run all runs every code cell from the top and
stops at the first error. [3] beside a cell is the order it ran in; [*] means queued or running.
The first run downloads Python (about 10 MB, then cached by your browser); numpy, pandas,
matplotlib, scipy and the rest of Pyodide’s packages
load automatically the first time a cell imports them.
Outputs. print output appears as it is written. The value of a cell’s last line is shown, as in
Jupyter (end the line with ; to hide it); display(x) shows a value mid-cell. pandas DataFrames
appear as tables, and every matplotlib figure a cell creates is drawn below it as a PNG (the Agg
backend; plt.show() works but is not needed). Errors show their traceback, with the cell’s own
lines. HTML("…") and Markdown("…") are available for rich output.
Stop and Restart. Python runs in a Web Worker, so the page stays responsive while a cell computes.
■ Stop ends a cell that is taking too long. On this site (GitHub Pages) the page cannot be
cross-origin isolated, which Pyodide needs to raise KeyboardInterrupt inside running code — so
Stop restarts the kernel instead, and variables are lost. Where the page is cross-origin isolated
(served with COOP/COEP headers), Stop interrupts the cell and keeps the namespace. ↻ Restart
starts a fresh Python.
Packages. %pip install some-package (or !pip install) in a cell installs pure-Python
wheels from PyPI with micropip before the cell runs; so does import micropip and
await micropip.install("…"). Packages with C extensions only work if Pyodide has built them.
%matplotlib inline is accepted and ignored; other IPython magics and !shell commands are skipped
with a warning. input() is not available.
Files. Upload file… copies a file (a CSV, JSON, Excel…) into the notebook’s working directory,
so pd.read_csv("sales.csv") reads it. Files your code writes appear in the list too, with a
download button. The file system lives in memory: it is gone when you close the page, and uploads are
copied in again after a restart.
Notebooks. Download .ipynb saves a standard Jupyter notebook (nbformat 4.5) with its outputs — it opens in JupyterLab, VS Code or Colab. Open .ipynb… reads one back (nbformat 4; outputs as saved, HTML in them filtered to tables and text). The notebook is saved in this browser as you work. Starter notebooks are pandas basics, plotting with matplotlib, NumPy linear algebra, statistics with SciPy (t-test, chi-square, regression, bootstrap) and a small simulation (an SIR epidemic, Monte Carlo π, random walks).
Share link puts the cells' sources (not their outputs) in the URL — good for small notebooks; large ones make very long links, so download the .ipynb instead. Opening a shared link keeps your own notebook one click away (Restore my notebook).
Markdown cells support headings, emphasis, lists, links, images, code, quotes and tables. Double-click a rendered cell to edit it; Shift+Enter renders it again. Raw HTML in Markdown is shown as text.
Browser support
Any current browser with WebAssembly and Web Workers: Chrome, Edge, Firefox and Safari 15+. Memory is the limit — a browser tab can use a few gigabytes at most, and big DataFrames use more than in native Python.
Privacy
Pyodide and its packages (MPL-2.0 and the packages' own open-source licences) are downloaded from
cdn.jsdelivr.net; %pip install fetches from PyPI. Your code, data and uploaded files stay on your
device: they are never sent anywhere. The notebook is kept in this browser’s local storage (large
figures are dropped from the saved copy if it gets too big). A share link contains the code of every
cell.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser — network requests go only to the services named on this page.