Share this page:

Code Notebooks

Among other things, it is advantageous for reproducibility if comments, code and research results are summarised in one document. In a code notebook, executable code, texts, visualisations and other multimedia content can be combined, code can be written interactively, explorative analyses can be carried out or code projects can be developed and presented.

A code notebook therefore makes it possible to encapsulate your research in a single “document” and, for example, to execute and explain code and thus present and open up your research work.

A well-known example of code notebooks is Jupyter Notebook. They can be used to create and exchange documents containing live code, equations, visualisations and documentation. Many programming languages, such as Julia, Python and R, are supported.

Code Notebooks require a corresponding software environment. If you do not want to or cannot install this locally, there are often so-called cloud environments for code notebooks. Jupyter, for example, provides its own cloud-enabled environment for Jupyter Notebooks with JupyterHub. Cloud-enabled means that JupyterHub only offers the technology, but not hosting in a cloud environment. In principle, each institution can set up its own JupyterHub environment locally and use it to provide its researchers with Jupyter Notebooks. There are also commercial providers in the Google and Amazon environment. With MyBinder, there is an Open Source solution for starting and sharing Jupyter Notebooks directly from a Git repository. However, the environment is considered temporary. This means that changes cannot be saved directly in the MyBinder environment, but can at least be transferred back to the GitHub repository. In the future, the European Open Science Cloud (EOSC) also wants to offer a service for Jupyter Notebooks.

Jupyter Notebooks are widely used in science. For example, they can be shared on platforms such as GitHub auf Tool-Eintrag. Furthermore, Jupyter Notebooks are accepted by journals of the American Economic Association (AEA) to check the research results of a publication for reproducibility.

If you cannot map an execution environment for your code with a code notebook, a container could also be an option.

Tip: With “How to Use Jupyter Notebook: A Beginner’s Tutorial Dataquest offers a good introduction to Jupyter Notebooks.