Skip to content
Chapter 6 of 7 · Python for AI workReproducing a notebook result

Chapter 6 of 7

Reproducing a notebook result

A notebook's saved outputs record what some kernel session produced, not what the file computes: cells run out of order and variables survive edits, so a committed notebook can show a chart no top-to-bottom run can reproduce. This chapter covers reading execution_count to see the real execution order, why hidden state is a design property rather than a defect, how to attempt a reproduction before automating anything, and the four smallest changes — an imported module, an asserting final cell, nbconvert in CI, and a cache that makes the run fast enough to bother with — that make a monthly number defensible.

Python for AI work — read the current version at https://daviddominguez.dev/learn/en/python-for-ai-work/reproducing-a-notebook-result

Back to top