The one idea: A notebook can show numbers that its own code, run fresh, would never produce — because cells run in any order and the page keeps old results on screen. The only way to trust what you see is to restart and run every cell top to bottom, then confirm the conclusion's number actually appears in the output.
⚠️ The trap: The number printed directly below a cell was obviously produced by that cell. That feels right and it's wrong. The bracketed counters (In [5]vsIn [3]) record the real run order, and a cell run out of order leaves a stale output sitting under code that never produced it — only Restart and Run All forces every output to match the code above it.
Analysis doesn't arrive as loose code — it arrives as a Jupyter notebook: a document of cells mixing code, output, and prose, usually ending in a conclusion someone wants you to act on. Notebooks are wonderful for exploration and treacherous as evidence, because a notebook can display results that its own code, run fresh, would not produce. This lesson teaches you to read one like an auditor: what cells and execution counters mean, why display order lies, and the one procedure that makes a notebook's outputs trustworthy.
Cells, outputs, and the execution counter
A notebook is a stack of cells. Code cells show three things: the code, its output below, and — crucially — a number in brackets on the left:
In [4]: df = conv.merge(spend, on=['date', 'channel'], how='inner')
len(df)
Out[4]: 273
That [4] is the execution counter: this cell…
Keep reading: Reading a Notebook End to End
Unlock the full Python Coding track — every lesson, the AI tutor, and full mock assessments.
- Full lesson content
- AI tutor for this section
- Practice questions