Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Different options for working with notebooks

In this course, we work extensively with Jupyter notebooks (.ipynb). Before you start coding, you need to make one practical decision:

Where will your notebook run?

Your main options are:

Running notebooks locally in VS Code is highly recommended because it gives you the most control over your files, your Python environment, and your workflow. However, if you need more time to set up your local system, you can use one of the online options described below to avoid falling behind.


1. Which option should I use?

Use this page as a decision guide:

The important distinction is that reading a Jupyter Book page and working in a notebook are not exactly the same thing. The book page helps you understand the concept. The notebook file (.ipynb) is where you edit code, run cells, save your work, and develop your own solutions.


2. Running notebooks locally

To get started with Python in this course and beyond, for example for your BSc or MSc thesis, running notebooks locally is the best option. A local setup gives you:

The setup process is explained in the Setup guide of the book. In short, you need:


Get the course files

The SDS210 course materials are provided in a course repository. The repository contains the lesson data, practicals, and notebooks in Jupyter Notebook format (.ipynb).

You have two options to get the files:

Recommended: clone with Git
Alternative: download ZIP

If you are comfortable using Git, clone the repository. This is the best option because you can update your files later with git pull.

git clone https://gitlab.com/HendrikWulf/sds210.git

Then move into the repository folder:

cd sds210

To update the repository later, run:

git pull

Create the course environment sds210

The environment.yml file in the course repository contains all information needed to set up your Python environment.

If you have not yet installed Conda, download and install Miniconda. Follow the default installation settings described in the Conda setup chapter.

After installing Conda, open Anaconda Prompt on Windows or your Terminal on macOS or Linux.

Then run the following commands:

# Navigate to the extracted or cloned SDS210 folder
cd <path-to-sds210-repository-folder>

# Create the SDS210 environment
conda env create -f environment.yml

# Activate the environment
conda activate sds210

Once the environment is activated, you can select it as a notebook kernel in VS Code or start JupyterLab from the same terminal.


IDE option 1: VS Code

VS Code is the recommended local notebook environment for this course. It combines notebooks, scripts, terminals, Git support, and extensions in one workspace.

To run a notebook in VS Code:

  1. Activate your Conda environment sds210.

  2. Open your SDS210 project folder in VS Code.

  3. Open the .ipynb file you want to work on.

  4. Select the correct Python kernel if prompted.

  5. Run the notebook cells and save your work regularly.

Both installation and environment setup are explained in the Conda and VS Code setup guides.

VS Code provides a notebook interface similar to JupyterLab, but it is integrated into a full code editor. This is especially useful once your projects grow beyond a single notebook.


IDE option 2: JupyterLab

JupyterLab is a classic browser-based notebook environment. It is a good option if you prefer a focused notebook interface.

Once you have created and activated your sds210 environment, start JupyterLab with:

# Activate the environment
conda activate sds210

# Move into your SDS210 project folder
cd <path-to-sds210-repository-folder>

# Start JupyterLab
jupyter lab

JupyterLab will start in the folder from which you launched it. You can then open any notebook (.ipynb) in the browser interface.


Local setup checklist

Before starting a notebook locally, check:


3. Running notebooks online

Online options are useful if you are having trouble setting up your local environment or if you want to quickly test a notebook without installing anything.

However, online environments usually give you less control. Files may not persist automatically, startup can take time, and the available software environment may differ from your local setup.


Option 1: Colab

Google Colab is a free online service that lets you run notebooks in the cloud without installing Python locally.

For this course, Colab is the recommended online fallback if you want to get started quickly.

Many lesson pages provide an Open in Colab button near the top of the page. This opens a copy of the notebook in Colab, where you can run and modify the code interactively.

Colab is useful for:

Colab is less suitable for:


Option 2: Binder

Binder is another free online service that lets you run Jupyter notebooks in the cloud without local installation.

Binder launches a temporary Jupyter environment based on the course repository. Startup can take several minutes, especially when the environment has not been built recently or when many users access Binder at the same time.

The launch button (🚀) in the top-right corner can open the current notebook in Binder if this option is configured for the page.

Binder is useful for:

Binder is less suitable for:


Option 3: In-page execution

This Jupyter Book supports in-page execution, which allows you to run code cells directly on the book page without opening a separate notebook interface.

When you click the power button (⏻) at the top of the page, a temporary cloud-based Jupyter kernel is started in the background. Once the session is ready, you can execute code cells on the page and view the outputs inline.

In-page execution is useful for:

In-page execution is less suitable for:


4. Comparison of notebook options

OptionInstallation neededPersistent workBest for
Local VS Code / JupyterLabYesYesProjects and long-term use
ColabNoYes, if savedQuick start and fallback work
BinderNoNoTemporary testing in Jupyter
In-page executionNoNoSmall experiments on the book page

A simple rule of thumb:


5. Summary

This page introduced the different ways to run notebooks.

The recommended path is:

  1. Set up the sds210 Conda environment.

  2. Work locally in VS Code whenever possible.

  3. Use JupyterLab if you prefer a browser-based local notebook interface.

  4. Use Colab as an online fallback.

  5. Use Binder and in-page execution only for short experiments.

Learning to run notebooks reliably is part of learning to program. A notebook is not only a document with code; it is connected to a specific Python environment, a kernel, a working directory, and a set of files. Understanding this connection will help you avoid many common errors.

Next, go to the Practical chapter to actually run and edit cells, restart the kernel, and learn how to avoid hidden state.