iPython (er, Jupyter) Table of Contents

When working with large amounts of data, the various steps can all blend together. Without appropriate commenting, and explaination even a simple project can become incredibly opaque to an outside observer. Imagine being a manager and looking at lines and lines of code, numbers, and variables being assigned without any transparency.

In order to avoid this scenario it’s incredibly important to have a clear structure that is easy to read for anyone coming in. A very helpful way to show the process and even help establish an initial strategy is to include a table of contents.

Jupyter Notebook Table of Contents

The addition of a table of contents, regardless of how big or how small the project is, clearly defines what path the project followed. To include a table of contents in a jupyter notebook, the only tools needed are anchor tags at the desired locations.

Table of Contents are translated to links which reference other locations in the notebook. When it’s not in its link form it appears slightly less elegant:

Markdown Table of Contents

The structure follows the markdown link protocol. The displayed name of the link is enclosed in brackets [] , and then the reference to the anchor tags are in parenthesis preceded by a hash symbol (#).

The anchor tag is enclosed in the markdown cell that includes either a title to accompany the operation or a description of current processes.

Title With Anchor Tag in Markdown
Title With Anchor Tag After Markdown Conversion

This has been an incredibly useful tool to help keep work clear and organized. “Ordnung ist das halbe Leben” and this hopefully helps.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.