Workspace Setup
Before we move to the next section, let’s make sure everyone has a working Python environment with the right packages installed.
Option A — Google Colab (recommended)
Google Colab is a free, cloud‑based platform that lets you write and run Python code directly in your web browser. It provides an environment similar to Jupyter Notebooks, but without the need to install Python or any additional software on your computer. This makes it an ideal starting point for medics and healthcare professionals who want to explore machine learning without worrying about technical setup.
Colab also includes a wide range of pre‑installed scientific and machine‑learning libraries—such as NumPy, Pandas, Matplotlib, and TensorFlow—so you can focus on learning concepts rather than configuring tools. Notebooks are easy to share, collaborate on, and store in Google Drive, making it a convenient platform for both individual study and group work. With its simplicity and accessibility, Colab provides a smooth entry point into Python programming and practical machine‑learning experimentation.
If you are up for Colab, you can try to load the Penguins dataset by running this in a new notebook cell:
# Load libraries
import seaborn as sns
# Load the dataset
penguins = sns.load_dataset("penguins")
# Show the first few rows
penguins.head()Option B — Jupyter Notebooks (via uv)
Jupyter Notebooks are interactive documents that allow you to combine executable Python code, text, visuals, and equations in a single place. They run code in small, editable “cells,” making it easy to experiment, get immediate feedback, and document your reasoning as you go. This format is especially useful for learning and teaching machine learning, as it supports step‑by‑step exploration, visualisation of results, and clear explanations alongside the code.
There are several ways to install and run Jupyter Notebooks, ranging from full Python distributions like Anaconda to lightweight package managers and online platforms. For this course, we recommend using the uv package manager, as it provides a simple, reliable, and reproducible environment setup with minimal configuration.
A package manager is a tool that helps you install, update, and manage software libraries (called “packages”) for a programming language. For most python projects, uv will be a great choice of package manager.
Install uv
Package manager installation should only need to be done once on your computer. If you encounter any issues, see here for more installation methods to try.
Open your Command Prompt and run:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Open Terminal and run:
curl -Ls https://astral.sh/uv/install.sh | bashOpen Terminal and run:
curl -Ls https://astral.sh/uv/install.sh | bashAfter installation, check that uv is available by typing uv --version, then pressing enter. You may need to restart your terminal for the changes to take effect.
Move into Project Directory
To set up your Python environment, you need to be in your project directory. Follow these steps:
- Open your terminal.
- Create or navigate to your project directory.
Create a Virtual Environment
Enter the following command to create a minimal virtual environment:
uv init --bareThis will create a pyproject.toml file, which will record information on all of the packages you install in your virtual environment.
Install Packages
For all projects we need jupyterlab, this is where we edit code. This can be added to your project with this command:
uv add jupyterlabFor the Introduction to Data Analysis in Python course, you would need the pandas and seaborn package. You can add these with:
uv add pandas seaborn scikit-learnOpening JupyterLab
Now you can open JupyterLab with:
uv run jupyter labThis will take some time, and you will see text being printed in the terminal. Once JupyterLab is running, a browser window should pop open. This window should like similar to the image below.

Create a Notebook
To create a notebook, click the “Notebook” icon in the JupyterLab launcher. The window should now look like this:

In each cell, python code can be entered. It can be run by clicking the “Run” button or by pressing Shift + Enter.