Python Notebook
Cells that share one kernel, with NumPy, pandas and Matplotlib loaded. Charts and DataFrames render inline - no install, nothing sent to a server.
← VizLearnWhat this is
A notebook running CPython 3.12 with NumPy, pandas and Matplotlib, all compiled to WebAssembly and executing on your own machine. Nothing is uploaded and there is nothing to install.
The first run downloads the interpreter and the three libraries, which takes a while and only happens once per visit.
How a notebook differs
The other editors on this site run one program in a fresh namespace every time. Here the cells share one kernel: a name bound in cell two is still there in cell five, and running a cell again changes what the cells below it would now see.
That is the whole idea, and it is also the classic way to confuse
yourself — output can reflect a definition you have since
edited. Restart kernel forgets everything, and
Run all from the top proves the notebook still works in
the order it is written.
Keys and controls
Shift+Enterruns the cell you are in.Run allruns every cell from the top, in order.Add cellputs a new one at the bottom.- The number beside a cell is the order it last ran in, so you can tell what is stale.
What renders
- A cell ending in an expression shows that value, with no
print(). - DataFrames and Series come out as tables.
- Matplotlib figures appear under the cell as images.
plt.show()is optional. print()and full tracebacks, as a terminal would show them.
What does not work
input()— there is no stdin.- Network calls, so no
read_csvfrom a URL. Build a DataFrame from a dict, or paste the data in. - Reading files from your computer. There is an in-memory
filesystem, so
to_csvandread_csvwork on paths that live for the session. - Libraries beyond these three and the standard library. SciPy, scikit-learn and Seaborn are not loaded.
%matplotlib inlineand other IPython magics. Plots are inline anyway.
Speed, honestly
WebAssembly runs several times slower than a native interpreter, and everything happens on one core. Vectorised NumPy and pandas still beat a Python loop by the same wide margin here, so the lesson those comparisons teach holds — but a timing you take on this page is not a timing you can quote for a laptop.
A cell is stopped after thirty seconds. That restarts the kernel,
which means every name is gone, so reach for Run all
after it happens.
Somewhere to start
sales.pivot_table(index="city", columns="month", values="revenue")- Add a column with
np.whereand group by it. - Plot two series on one axis and give it a legend.
- Time a Python loop against the NumPy equivalent with
time.perf_counter.
The other editors
The Python compiler runs one script at a time without the libraries, and the Python track teaches the language one idea at a time. For the maths under NumPy, the Maths track covers vectors and matrices with the same run-it-yourself approach.