Python Course for Scientists

Welcome to the Python course for scientists, focussing on scientific data analysis and reproducible research. This course tries to present you with the larger picture of programming for scientific data analysis, beyond simple hacking of a few scripts that “just about work”. Science is (much) more, and at its heart it is as much about reproducibility as it is about the intrinsic curiosity of human mankind to answer the big questions of what? how? and why?

Warning

This course is currently work in progress and under active development. Expect frequent changes, incomplete contents and alike.

Note

This course is opinionated. It will usually focus on one and only one solution that works best for its author. The material and ideas presented stem from long-term personal experience. Therefore, it is up to the audience to read, understand, and take the advice as applicable. Read the full details.

Audience

Many scientists need to program on a routine basis in order to analyse their data. While being a necesary requirement, usually scientists are never taught how to program properly. This course tries to help out. Note that serious programming is quite different from writing scripts for single tasks. Read more about the audience.

What is in this course?

The course will span the whole range of topics from installing all necessary prerequisites (Python, virtual environments, an IDE), using basic infrastructure (version control, automatic documentation) via code formatting (PEP 8 and PEP 257) and checking to software architecture and design decisions.

The structure of the main course appears very similar to the book from Scopatz&Huff [Scopatz and Huff, 2015]. Admittedly, this book is an excellent read and each reader of this course is urged to read it as well. However, content-wise there are also clear differences of the course compared to this book and a slightly different emphasis.

Where to start?

The impatient should read the “before you start” section before they start installing Python and packages and start coding. If you’re interested in the details of why this course came into being, start right with the at the beginning. Otherwise, delve directly into the course. What follows is a short overview of the course structure, providing direct links as well to the different chapters and sections.

Tip

Familiar with programming and interested in a Python quickstart? Have a look at the Hello world section covering a whole list of topics from the first Python command in the Python interpreter to creating a Python package and even testing, passing scripts, functions, modules and object-oriented programming. Printing “Hello world” may never have been more exciting!