Imperial College London

Dr Edward R Smith

Faculty of EngineeringDepartment of Mechanical Engineering

Research Associate



+44 (0)7792 677 912edward.smith05 CV




149Roderic Hill BuildingSouth Kensington Campus




An introduction to Python

In order to address the lack of general Python teaching here at Imperial, I put together and gave a three part introduction course through the HPC support here at Imperial. This class was aimed at beginners and also for those who want to switch from Matlab to Python.

1)  Introduction to Python for scientific computing, 3/3/17 (Slides) (Solutions)
   a) Motivation for using Python.
   b) Introduction to programming in Python
   c) Python concepts (lists, iterators, etc) and discussion of the differences to other languages.
   d) Scientific libraries numpy and matplotlib.
   e) Examples of usage for scientific problems.

2)  Further details of the Python language, 10/3/17 (Slides) (Solutions)
   a) More on Python data structures: concepts like references, immutable, lists, data organisation with Dictionaries and numpy arrays.
   b) Use of functions and design of interfaces.
   c) Introduction to classes and objects.
   d) Structuring a project, importing modules and writing tests.
   d) Examples of usage for scientific problems.

3)  Python libraries, 17/3/17 (Slides) (Solutions)
   a) Using Python to read files (ascii, binary, hp5) and plot.
   b) Running parameter studies by calling executables repeatedly with subprocess.
   c) Designing a basic Graphical User Interface.
   d) Unit testing frameworks and version control.
   e) Other libraries and how to wrap your own code from fortran, c++, etc

HPC Summer School 2017

Given the interest in this course, I am running this again as part of the summer school.

This is split over two days:

The modular and object oriented approach taught in these course is the basis for open-source visualisation software, pydataview