Stockertim Dictionary · Technology
Code notebook
Also called computational notebook, Jupyter notebook, data notebook
In short
A document that mixes runnable code cells with their outputs, tables, charts and written notes, so an analysis can be run step by step and read by others.
- Beginner
- Technology
- Checked
In detail
A code notebook is a page made of cells. A code cell holds a few lines of Python, or another language, and when it is run its output appears directly underneath: a number, a table, a chart or an error. A text cell holds headings and explanation. Together they read like a report in which every figure sits next to the code that produced it.
Notebooks suit exploration. An analyst can load a file in one cell, look at it, filter it in the next, chart it in a third and change any step without rerunning the rest. The open Jupyter format, saved as an .ipynb file, is the most common, and many hosted and desktop tools open the same files.
The freedom to run cells in any order is also the main weakness. Variables persist in memory between runs, so a notebook can display results that no longer follow from the code on the page, because a cell was edited, deleted or run out of order. The fix is routine: restart the kernel and run all cells from the top before trusting or sharing the results.
For work that is repeated or published, teams often move tested code from the notebook into plain script files and keep the notebook as the narrative. Saved notebooks may contain outputs, including sample rows of data, so they need the same care as the data itself before being shared or committed to a repository.
Worked example
A researcher at a housing charity in Leeds builds a notebook to count repair requests by month.
- Cell 1 loads 2,400 requests; cell 2 groups them into 12 months, an average of 2,400 / 12 = 200 a month.
- Cell 2 is later edited to exclude 240 duplicate requests, but cell 3's chart is not rerun.
- Restart and run all: the chart redraws from 2,400 − 240 = 2,160 requests, an average of 2,160 / 12 = 180 a month.
The rerun from the top brings the chart into line with the code before the notebook is shared.
In practice
Analysts, data scientists and teachers use notebooks for exploration, teaching and short reports. Government analysts often pair them with version control and move reusable steps into tested modules as part of reproducible analytical pipelines.
Watch out
- Cells run out of order can show stale results; restart and run all before relying on the output.
- Saved outputs can contain personal or confidential data; clear them before sharing where needed.
Learn it properly
Official sources
- Reproducible Analytical Pipelines strategy · Government Analysis Function
- Maintaining version control in coding · Government Digital Service, GOV.UK
Facts last checked on 9 November 2026.
Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.