Jupyter Notebooks: Code, Results, and Documentation in One Environment

Source code, its outputs, explanatory text, and visualizations can all be combined in a single interactive document. This is the principle behind Jupyter Notebooks, which are widely used for data analysis, teaching, prototyping, and documenting computational workflows. They have found their place across a broad range of disciplines. Data analysts and researchers use them for data processing, data stewards for dataset management, and they also serve as a valuable teaching tool for students.

21 Aug 2026 Kateřina Kolaříková Lucie Sobková

No description

What is a Jupyter Notebook?

A Jupyter Notebook is an interactive document made up of individual blocks known as cells. Some cells contain source code, while others contain explanatory text, equations, images, or headings.

The output of executed code, such as a table, chart, statistical result, or error message, is displayed directly below the relevant cell. A notebook can therefore bring together a problem or task description, program code, computational results, charts and tables, explanations of the methods used, and conclusions and interpretations of the results in one place.

The notebook itself does not execute program code. This is handled by a separate computational process known as a kernel, which is connected to a specific programming language and environment.

One of their main advantages is the combination of code, results, and commentary. Users can easily see how individual parts of the code relate to the resulting charts and how the presented values were obtained. A notebook can also serve as teaching material. Individual steps can be supplemented with explanations, while users can modify the code directly and observe how the result changes.

No description

JN are used in many areas:
- exploratory data analysis
- teaching programming and statistics
- creating charts and reports
- working with machine-learning models
- sharing results and exchanging information
- proof-of-concept experiments


How does a notebook work?

Code in a notebook is divided into cells that can be executed individually. This means that users do not have to run an entire program from the beginning each time, but can work in smaller steps and immediately inspect the results.

Notebook cells can be executed individually, repeatedly, and in any order. As a result, outputs do not necessarily correspond to the order of cells in the document and may depend on earlier operations. Before sharing a notebook, it is advisable to restart the kernel, clear its current state, and rerun all cells from the beginning. This helps verify that the displayed outputs genuinely correspond to the current version and order of the code in the notebook.

A typical notebook may include loading the required libraries, opening a data file and checking its structure, carrying out calculations or data transformations, and creating a chart. Individual steps can also be accompanied by comments explaining the workflow and the results obtained.

This way of working is particularly useful for exploring data, testing different approaches, or teaching. Users can see not only the final result, but also the individual steps that led to it.

No description

Python as a programming language

Python is one of the most commonly used languages in Jupyter Notebooks. Python itself, however, does not automatically analyze, clean, or visualize data. These tasks require specific code and suitable libraries that provide ready-made tools for working with data. Pandas is commonly used for tabular data, NumPy for numerical calculations, and Matplotlib, for example, for creating charts.

Jupyter notebooks can also leverage other features of the Python ecosystem, including virtual environments. These keep the dependencies of individual projects separate, which is useful when different projects require different versions of the same libraries, and a shared installation could cause compatibility issues.

There are several tools for managing environments and dependencies. One of the long-established options is Conda, which is widely used in data analytics and scientific computing. A more recent alternative is uv by Astral, which provides fast management of packages, virtual environments and project dependencies.

Uv can create a separate environment for a specific project, install the required libraries, record their versions, and later recreate a comparable environment on another computer.


Notebooks are most commonly used with the Python programming language, but they also support R, Julia, and many other languages. The name Jupyter itself is derived from the names of three languages: Julia, Python, and R.

Jupyter Notebook and JupyterLab are not the same thing

The terms Jupyter Notebook and JupyterLab are sometimes used interchangeably, but they refer to two different things.

A Jupyter Notebook is the interactive document itself. In contrast, JupyterLab is a broader web-based workspace where users can create and open notebooks, manage files, work in a terminal, view data files, and use additional applications.

After launching JupyterLab, users enter an interface similar to a file manager. They can browse directories, create folders, open existing notebooks, or create new working documents.


How to use JupyterLab

One of the advantages of JupyterLab is that it brings multiple parts of the workflow into a single environment. For example, users can open a notebook, a source data file, a terminal, and the documentation for a particular library side by side.

One option is to install JupyterLab directly on your own computer. In this case, users have full control over the environment and can customize it to suit their project’s needs.

Another option is to use JupyterLab as a remote service. The Czech research community can, for example, work in an environment provided by the national research infrastructure e-INFRA CZ. The advantage is that users do not need to install the entire environment themselves and can use preconfigured computing resources and related services.

Before uploading data to a remote environment, it is always necessary to consider whether the data contains personal or sensitive information, whether contractual restrictions apply, where the data will be stored, and who will have access to it. It is also important to verify that the selected service meets the legal and security requirements for working with the given data. Anyone can also explore the JupyterLab interface without installation through the demo environment available at jupyter.org.


AI Assistant in JupyterLab

An AI assistant can also be connected to JupyterLab via an API. It can help, for example, with suggesting code, explaining an error message, or recommending a suitable library.

Within the JupyterLab environment provided through e-INFRA CZ, preconfigured Data Science AI images with integrated Jupyter AI support are available. Users can therefore work with AI assistants directly in JupyterLab and use models provided through the infrastructure without having to configure the connection themselves. All that is required is a MetaCentrum account and selecting the appropriate image from the list of available options when launching the Jupyter environment. The environment also supports the integration of additional tools, such as Claude Code, uses internal LLMs, and keeps data within the infrastructure. Further details are available in the service documentation.

An AI assistant does not automatically produce correct and executable code. Its suggestions may contain errors, use non-existent functions, or misinterpret the task. Any generated code should therefore always be read, tested, and verified by the user. One of the specialized AI assistants available in JupyterLab is bia-bob (Bio-Image Analysis Bob), which primarily focuses on biological image data. It is therefore a specialized tool designed primarily for bioimage analysis, rather than a general-purpose assistant for all JupyterLab users.

The training session JupyterLab AI Assistant as Data Steward Workbench explains how to connect and configure the bia-bob assistant. An overview of AI tools available through e-INFRA CZ is also provided in the recording, AI Tools (Not Only) for Research.


When to choose a different solution

Notebooks are well-suited to interactive work, documented analyses, teaching, and prototyping. However, they are not necessarily the ideal tool for every situation. If a workflow needs to run regularly without user intervention, become part of a production service, work with very large datasets, or be maintained over the long term by a larger team, it may be more appropriate to move the main logic into standalone scripts, program modules, or data pipelines.

The notebook can then serve as documentation, a demonstration, or an interface for interpreting the results. It is also good practice to move repeatedly used functions into separate files. This keeps the notebook clear and makes the program code easier to test and reuse in other projects.


An interactive document, not a universal solution

The main advantage of Jupyter Notebooks lies in their ability to combine code, outputs, and explanations. They make it possible to follow the workflow, experiment with different approaches, and share results in an understandable form.

However, a notebook is not a self-contained analytical tool, nor does it automatically guarantee a good or reliable result. Its quality depends on correctly written code, a properly managed computational environment, the availability of input data, and clear documentation. When these conditions are met, a notebook becomes a useful environment for analysis, collaboration, and knowledge sharing.


Sources and further information

   


More articles

All articles

You are running an old browser version. We recommend updating your browser to its latest version.