Jupyter notebooks are a valuable tool for data analysis and exploration, as well as for exploratory programming. In this training you will learn how to use Jupyter notebooks effectively for visualization and experimenting. Jupyter notebooks can be used with multiple kernels for different programming languages, and it is also possible to mix different languages in a single notebook. You will also learn that Jupyter notebooks are not idealy suited for production environments, and you will learn how to convert notebooks to scripts.
Learning outcomes
When you complete this training you will
- be able to use notebooks for story telling, i.e., mixing code, text, visualizations, and equations;
- know some notebook magic;
- be able to use various interactive visualization and animation libraries;
- be able to pair notebooks with other formats to facilitate version control;
- be able to install and use kernels for Bash and R;
- know how to interact with the Bash shell from withing a Python notebook;
- know how to interoperate between Python and R in a single
notebook using
rpy2; - be able to create a simple slide show from a notebook.
Schedule
Total duration: 3 hours.
| Subject | Duration |
|---|---|
| introduction and motivation | 5 min. |
| basics of notebooks | 25 min. |
| notebook magic | 10 min. |
| interaction and animation | 30 min. |
| pairing notebooks for version control | 15 min. |
| using the R kernel | 10 min. } |
| using the Bash kernel | 10 min. } |
| Bash in a Python notebook | 10 min. |
| R in a Python notebook | 10 min. |
| creating a slide show | 10 min. |
| JupyterHub | 10 min. |
| wrap up | 5 min. |
Training materials
Slides are available in the GitHub repository, as well as example code and hands-on material.
Target audience
This training is for you if you need to use Jupyter notebooks.
Prerequisites
You will need experience programming in Python or R. This is not a training that starts from scratch. You should also be familiar with using the command line in Linux.
Quick self-assessment
If you can do most of the tasks below, you are likely ready for this training.
- run a short Python or R script;
- open a terminal and navigate to a working directory;
- write a few lines of Python or R that define variables and call a function;
- read a short error message from Python or R and identify roughly where the problem occurred;
- make a small change to a script or command and run it again;
- explain the difference between code, text, and generated output in a computational document.
If several of these items still feel difficult, the training will probably move too fast. In that case, it is better to first refresh basic Python or R and basic command-line use.
You do not need prior experience with JupyterLab itself, creating notebooks, adding Markdown or code cells, running cells, or managing notebook output. Those are demonstrated during the training.
Software and access requirements
For following along hands-on, you need
- laptop or desktop with internet access and a Python interpreter, or
- access to a JupyterHub server, e.g., Google Colab or Binder.
Level
- Introductory: 60 %
- Intermediate: 30 %
- Advanced: 10 %
Trainer(s)
- Geert Jan Bex (geertjan.bex@uhasselt.be)