Seminar 1 - Introduction to Python

Pre-session questionnaire

Before going through the seminar materials please fill in this questionnaire.

What is Python

Python is an interpreted high-level scripting language used widely for data science and supporting object-oriented programming. Its open-source nature with a comprehensive standard library, particularly for scientific programming, makes the language very popular amongst engineers.

Why Python

We will be using Python and Jupyter notebooks to demonstrate some of the analytical concepts that we will be covering in this module. Python will also be used for some aspects of your assignments.

Our expectation is that you will be all familiar with the basics of programming, through your earlier exposure to Matlab in Years 1 and 2. To support you in this transition, in this session we will be explaining the basics of Python, and will also discuss the differences between Matlab and Python.

Seminar video



View in Panopto

Download slides

Handouts

Since most of you will be using Python and Anaconda for the first time, we have produced the following step by step guides to help you get set up.

The most efficient way to get Jupyter up and running is using a terminal - as we expect that this is going the first time that many of you will be using this functionality, we have included some guidance on how to access it, and on how you can use it to navigate your filesystems.

Windows version

macOS version

Codes

During the seminar, He-In used the Fibonacci algorithm as an example of how you could use Python to implement algorithms. In the links below you can find the codes that were used (as well as an equivalent Matlab version, for reference)

Python version

Jupyter notebook version (right click on link and save as)

Matlab version

We would recommend that you open these codes and see how they work. If you encounter any issues, please do not hesitate to ask for support!

Datacamp

Furthermore, we have made available a series of short Python training modules in the Datacamp platform. These are:

The completion of these modules is essential and will form your first assignment for this module.