Skip to main content

Overview


Aims

This course is aimed at researchers working in the natural sciences, particularly Environmental Sciences. It assumes no prior knowledge of programming.

This is a hands-on introduction to the basic principles of Python. By the end of the course, you should be able to use Python independently for your work.

This course will cover:

  • basic programming principles: data structures, operations, tests and loops
  • debugging and fixing errors
  • input/output of data
  • data analysis and scientific computing with NumPy
  • an introduction to plotting with matplotlib

This course will not cover:

  • advanced Python topics such as exceptions (e.g. errors), writing modules, decorators, coding style
  • object oriented programming
  • specialised Python packages, apart from an introduction to NumPy and matplotlib

Python Version 2

This courses concentrates on teaching the version 2 of Python. A newer version of Python exists, version 3, but it is not completely backward compatible with version 2. This means that code written for version 2 may work differently in version 3 (or not work at all) and vice versa.

Why continue teaching and using an old version of Python ? We've chosen to teach version 2.7 because some packages are not yet compatible with version 3.

You can read more information on the difference between Python 2 and 3.

Course Structure

This course is structured in 15 levels distributed amongst four parts offering a progression in the knowledge and skills you’ll acquire.

Part 1: Getting Started

This part has two sections:

  • Introduction
  • How to Use Python

At the end of Part 1, you will have an idea of how you could use Python in your work. You will also learn to start python and input and run code.

Part 2: Python Basics

This part covers the basic principles of programing and how you write building blocks of code in Python to:

  • Operations
  • Data manipulation
  • Conditional actions
  • Repetitive actions

At the end of Part 2, you will have enough knowledge to write simple programs for your work.

Part 3: Expand Your Repertoire

This part teaches you more data and code structures, to provide you with more flexibility in writing code, in particular it covers:

  • More data structures
  • More ways of coding repetitive actions
  • Reading/writing files
  • Organising your code in functions

At the end of Part 3, you will have acquired more proficiency in writing code through more challenging exercises.

Part 4: Scientific Python

The final part introduces two essential packages for scientific work:

  • NumPy to manipulate, read and write arrays
  • matplotlib to plot data

At the end of Part 4, you will have enough knowledge to use the NumPy and Matplotlib tutorial and the documentation on the web to expand your knowledge. You will also be able to learn to use specialised packages on your own.

Glossary

A glossary is available that lists the commonly used terms and commands.