Skip to main content Skip to navigation

Labs

Running the code for Labs 1-9

There are two ways to run the code, either locally or remotely.

Locally

There are lots of ways to work with the Jupyter Notebooks locally e.g.

Using VSCode

If you are using VSCode on your own personal computer, you will need the following things:
  • VSCode (can be found here)
  • Python 3 (can be found here)
If you are using the DCS system, these have already been installed for you.
If you want to run the code locally, you will need a few extensions for VSCode. This will allow VSCode to fully understand the .ipynb files. This can be done through the following commands in your terminal:
code --install-extension ms-python.python

code --install-extension ms-python.vscode-pylance

code --install-extension ms-toolsai.jupyter

code --install-extension ms-toolsai.jupyter-keymap

code --install-extension ms-toolsai.jupyter-renderers
Once this is all done, you can then open VSCode using the following command in your terminal:
code <~/path/to/your/directory>
The first time you run the python code blocks, VSCode may ask you to select a version of Python (especially if you have multiple version installed). In this case, select the highest version of Python 3 available.

Using Jupyter Lab

If you are using Jupyter Lab on your own personal computer, you should navigate to the directory where you will be working using the terminal and create a new Python virtual environment in the current directory (./) using e.g.
python3 -m venv ./

This will allow you to install packages without affecting the system-wide Python installation. You then need to activate the virtual encironment using

source bin/activate

install jupyterlab using

pip3 install jupyterlab

run jupyterlab using

jupyter lab

A virtual environment is a self-contained directory that contains a Python installation and allows you to install packages without affecting the system-wide Python installation.

The DCS machines can be accessed at any time remotely using VNC. Instructions on how to do this can be found here.

Remotely

If you don't want the hassle of installing VSCode and you have a Google account, you can use Colab. You will need to download the files to your machine, then upload them to Colab individually. You can then save them to Google Drive, or download them to run on your local machine.

Files and Datasets

All the files required for these labs can be found on the right hand side. We are also keeping a collection of datasets that are utilised in the labs, and that might be interesting for further use. These can be found here.

Contacts

    Let us know you agree to cookies