Scientific Programming in Python


Course information

This postgraduate course is designed to give a general introduction to the Python programming language and its wider ecosystem, with a focus on the elements most important for data analysis and scientific research.

The course is aimed at students on the MSc Machine Learning in Science (MLiS) programme at the University of Nottingham (for which it is PHYS4038) as well as first-year PhD students at the University of Nottingham and a number of other institutions, via the Midland Physics Alliance Graduate School (MPAGS AS1). Students taking this module are expected to have a limited level of prior programming experience, but not necessarily in python.

Joining the course

MSc students should enrol via the University of Nottingham module enrolment form, after discussing their options with their tutor. You can self enrol on the module Moodle page

PhD students should enrol for the module via the MPAGS module sign-up page. If you are enrolling late, please also email the convenor.

Getting Setup

If you are taking this course in person at Nottingham the workshops will use computers already containing the necessary software. However, if doing the sessions remotely or setting up your own computer for work outside the sessions you will need to install the following:


You will need to create a github account. If attending in person we will do this in the first session. Registration with github classroom can then be done by clicking on an email link to the first weeks files. This will be sent out in the week commencing 2nd October. If you do not receive this link please contact me.

On vscode you should install a few extensions.

Lecturer contact

The course is taught by Dr Mike Smith. Outside of synchronous teaching sessions you can contact him via email.


The main course runs for the whole of the Autumn term.


An outline of the topics is given below. This may be slightly altered and expanded as the course progresses.


The assessment varies depending on whether you are taking this module as a taught masters student or via MPAGS (Research Masters / PhD students)

Taught Masters students

Assessment for this module comes in 3 parts:


To qualify for MPAGS credits, you will need to demonstrate sustained engagement with the course. This includes submitting an acceptable effort at the exercises in the taught sessions and producing a Python program. Your program may address any scientific purpose you like, e.g. data analysis, simulation, modelling, experiment control, visualisation, etc. Ideally the program will do something that is relevant for your research projects. MPAGS students are not required to take the in-class test.

Project Code Guidelines

A project template is provided as an assignment, which you can synchronise in the same way you do with the exercises each week.

We ask that where possible projects are submitted as a Jupyter Notebook (*.ipynb). The Jupyter Notebook should not only provide code but be structured with Markdown cells which explain:

We do recognise that there are certain projects using, for example GUI frameworks where a set of code files is better. In this case you will need to submit a pdf report covering the above points.

In addition to the Jupyter Notebook / code, you should also submit:

Your program should (as a rough guide)…


Taught MSc students must also have a short viva (5 mins) with members of staff which will be held during the 8th week of the course (Week commencing Nov 27th) of term. The only preparation necessary for this viva is to ensure you are familiar with the project you have submitted. This will take the form of a code review. You’ll be asked questions about your code, design decisions and alternative approaches you might have taken.