5  Self study - Session 1

This class contains self-study sessions to reinforce your understanding of the material and explore other aspects of the topic in a self-guided manner. This session introduces JupyterLab and Jupyter Notebook.

Jupyter Notebook is an open-source web application that allows users to create and share documents containing live code (supports over 40 programming languages including Python, Julia, R), visualizations, and narrative text. JupyterLab is a web-based interactive development environment (IDE) for Jupyter Notebook. The Jupyter ecosystem is widely used for interactive exploration and reporting purposes.

Exercise 5.1 (Introducing JupyterLab)  

Study the JupyterLab documentation to learn about its features and capabilities and experiment with them using your JupyterLab environment.

Use uv to create a new environment and install jupyterlab.

After this exercise you should be able to answer the following questions:

  1. What is a Jupyter Notebook?
  2. What is JupyterLab?
  3. What are the different types of cells in a Jupyter notebook?

And you should be able to do the following:

  1. Create notebooks.
  2. Export notebooks to other file formats (like e.g. HTML and PDF).
  3. Create and run code cells
  4. Create and format markdown cells
  5. Use raw cells for unformatted text

Exercise 5.2 (Using JupyterLab)  

  • Create a notebook from the code provided in Chapter 4. Be sure to divide the code into separate cells for each logical step.
  • Use markdown cells to explain and structure the code.
  • Ideally, each code cell is self-contained and focuses on a single task or concept. E.g. it is good practice to define and alter variables only within the same cell; especially multiple calls of a cell should not cause different results.

Exercise 5.3 (Interactive plotting)  

seaborn plots are not interactive by default. The package ipympl enables zooming and panning of plots in Jupyter notebooks. Start with the notebook from the previous exercise and activate the ipympl backend by following the documentation.