Data & Setup

Attendees

Please follow the instructions below to install python before the course. For Microsoft Windows machines, utilising WSL2 (Windows Subsystem for Linux 2) is advised.

Data

The data used in these materials is provided here:

Data for Session 1 and 2:

Data for Session 3 Escape Room:

Software

WSL2 (Microsoft Windows machines)

There are detailed instructions on how to install WSL on the Microsoft documentation page. But briefly:

  • Click the Windows key and search for Windows PowerShell, right-click on the app and choose Run as administrator.
  • Answer “Yes” when it asks if you want the App to make changes on your computer.
  • A terminal will open; run the command: wsl --install.
    • This should start installing “ubuntu”.
    • It may ask for you to restart your computer.
  • After restart, click the Windows key and search for Ubuntu, click on the App and it should open a new terminal.
  • Follow the instructions to create a username and password (you can use the same username and password that you have on Windows, or a different one - it’s your choice).
    • Note: when you type your password nothing seems to be happening as the cursor doesn’t move. However, the terminal is recording your password as you type. You will be asked to type the new password again to confirm it, so you can always try again if you get it wrong the first time.
  • You should now have access to a Ubuntu Linux terminal. This behaves very much like a regular Ubuntu server, and you can install apps using the sudo apt install command as usual.

Configuring WSL2

After installation, it is useful to create shortcuts to your files on Windows. Your main C:\ drive is located in /mnt/c/ and other drives will be equally available based on their letter. It may be convenient to create shortcuts to commonly-used directories, which you can do using symbolic links. Here are some commands to automatically create shortcuts to your Windows “Documents”, “Desktop” and “Downloads” folders:

ln -s $(wslpath $(powershell.exe '[environment]::getfolderpath("mydocuments")')) ~/Documents
ln -s $(wslpath $(powershell.exe '[environment]::getfolderpath("desktop")')) ~/Desktop
ln -s $(wslpath $(powershell.exe '[environment]::getfolderpath("downloads")')) ~/Downloads

You may also want to configure the Windows terminal to automatically open WSL2 (instead of the default Windows Command Prompt or Powershell):

  • Search for and open the “ Terminal” application.
  • Click on the downward arrow “” in the toolbar.
  • Click on “ Settings”.
  • Under “Default Profile” select “ Ubuntu”.

Python

We recommend using the package manager Mamba to manage your Python installation and environments. Our recommendation is to create separate environments for each project or type of analysis, to avoid package version conflicts. In this page we give an example of creating an environment for our Python introduction course, which includes Jupyter Lab and some essential packages for data analysis. You will need python version 3.11 or later for this course.

First install Mamba

Follow the instructions on the mamba installation page. Then return to this page.

  • Open a terminal (macOS and Linux) or the Miniforge prompt (Windows)

    • Ensure that the shell starts with the word (base), indicating Mamba is correctly installed.
  • Create a new environment, which we will call pycourse (you may give your environment a name of your choice):

    mamba create -n pycourse python=3.11
  • Install JupyterLab (for notebook interface):

    mamba install -y -n pycourse jupyterlab
  • The installation should complete with the following message:

    Downloading and Extracting Packages
    
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
  • Once installed, you can start JupyterLab by activating your environment and running the command to launch it:

    mamba activate pycourse
    jupyter lab
  • JupyterLab should open in your browser automatically. If it doesn’t, you can click the link that appears on the message printed on the screen: