Jupyter notebooks can become a chaotic mess after a few hours of work.
All of the focus is initially on getting the code to work, to display some pretty outputs or to visualise machine learning model metrics. Reworking the the code into something that others (or yourself in six months time) can follow is often forgotten.
The code might be correct, and the the analysis might hold up, but anyone picking it up cold is left to reconstruct your reasoning and thinking from scratch.
They start to ask questions like
What was filtered out and why?
What does that intermediate result means?
Why one step leads to the next.
Even when the answers are technically somewhere in the code, they can take far too long to find. The problem is not usually the analysis itself, but rather it is the missing context around it.
The gaps between cells
A notebook without narrative tends to look like this: imports, data load, some filtering, a plot, more filtering, another plot.
The reader doesn’t know why you did any of these, because you didn’t say. When you wrote it, you didn’t need to as it was obvious to you at the time.
A sentence or two between logical steps is usually enough to close the understanding gap, for example
That markdown cell took thirty seconds to write and it tells the reader what you saw, what you decided, and why the next cell exists. Without it, they would still be guessing and trying to follow what was happening based on the code.
Magic numbers are hidden reasoning
One of the more common sources of confusion in notebooks is the unnamed constant. A threshold, a cutoff, a multiplier chosen for a good reason at the time of writing now becomes invisible.

Where did 15 come from? What’s 120? Is 0.4 a standard cutoff or something specific to this well?
Compare that to:

Same values, same result. The second version takes maybe two extra minutes to write, but anyone reading it can see what the numbers represent and where they came from. If someone needs to change the cutoff, they know exactly where to look.
Burying the numbers in the equations and code makes the notebook harder to audit and harder to hand over.
Cells that do too many things
The overloaded cell is easy to miss when everything is working.
Imports, data loading, column renaming, filtering, and a plot all in one block. It’s fine until something breaks and you have to unpick the whole thing to find it. An example of this can be seen below.

Breaking it into logical units doesn’t mean every line gets its own cell. It means grouping by purpose and giving each group a brief header.
The code itself hasn’t changed, but it has become much easier to navigate, easier to debug when something breaks, and easier for someone else to work out what’s happening at each step.
Grouping cells by purpose also makes a notebook easier to return to months later. I’ve written about the naming and folder conventions that make that work in practice on Substack. Link at the end.
Unlabelled outputs are just as opaque
The same readability problem that affects code also affects outputs. A plot with no title, no axis labels, and no surrounding explanation is the visual equivalent of a magic number. The person who made it knows what it shows, but it can be difficult for anybody else to work out what the chart is trying to show.
For any figures that end up in reports or presentations, this becomes a real problem. An axis label that reads perm is not the same as one that reads Permeability (mD). Similarly, a title that says Formation scatter tells the reader almost nothing.
I wrote about this recently in Six Matplotlib Changes That Improve Your Figures for Reporting and Publication
The fix is the same as for magic numbers: make the context explicit.
Label the axes
Add a descriptive title
If the figure is making a specific point, say so either in a markdown cell above it or as an annotation directly on the chart
A notebook full of readable code, but unlabelled plots is still half finished. The outputs are part of the document too and often times that is what you come back to the notebook for. For example, you may want to grab the figure for your technical paper or for passing onto a client.
A notebook is a document too
There’s a useful distinction between a notebook you’re using to think with and one you’re handing to someone else. The exploratory version: where you were trying things, backing up, dead-ending, isn’t the same thing as what a colleague needs to understand or verify your work.
The gap between the two is smaller than it looks. The things that make a notebook readable (a few markdown observations, named constants, cells grouped by purpose, labelled figures) can add up to less than an hour for a notebook that took days to build. It’s not glamorous work, but it’s the difference between something you’re comfortable handing over and something you need to walk someone through in person.
Making individual notebooks readable is one half of the problem. The other half is what happens when you have dozens of them across different projects and you need to find something from six months ago. Over on Substack I’ve written about a lightweight system for naming, organising, and indexing notebooks so older work stays usable without turning maintenance into a side project.
Check out ot below
How to Organise Jupyter Notebooks So Older Work Stays Usable
In the previous article, I looked at the project structure around a notebook: a consistent folder layout, a central config.py for paths, reusable code in src/, and a Cookiecutter template to generate the whole setup quickly.








