1  Introduction

1.1 What is Python?

Python is a general-purpose programming language that is very popular in the scientific community. At Utrecht University it is the most popular programming language for open source research projects @ UU (see SWORDS-UU).

Programming languages by user

Python is popular due to its readability, ease of use, its large community, and its large ecosystem of packages that can be used for a large variety of tasks, ranging from data analysis, modelling, simulation, machine learning to web development.

Python is open source, which means that it is free to use and that the source code is available for anyone to inspect and modify. This makes it easy to install Python on any computer, and e.g. share code with others or scale up your computations to a high performance computing system.

1.2 Scope of this course

Programming is a skill that takes time and practice to learn. This course will not make you an expert programmer, but it will give you a small foundation to build on. The course will focus on the basics of the Python language, and simple data handling and visualization with the Pandas Python library. This will be enough to demonstrate the power of Python and hopefully inspire you to learn more. After the course you will have some basic knowledge to get started and we will be available during the RDM walk in hours and the Programming cafe to help you continue your learning journey and start using Python in your own research.

1.3 Jupyter Notebooks

There are many programs that can be used to edit and run Python code. This course will use Jupyter Notebooks. Jupyter Notebooks are a way to combine text, code, and output in a single document. Jupyter Notebooks are a great way to learn Python, as you can run code in small chunks and immediately see the results. But this doesn’t mean Jupyter Notebooks are only for beginners. Jupyter Notebooks are used by many professional programmers and scientists to share their work and even do computationally expensive analyses.

See below how a Jupyter Notebook looks like. The notebook is divided in text cells and code cells. The code cell contains Python code, which can be executed by pressing the ‘play’ button in the toolbar or by pressing Shift + Enter. The output of the code is shown below the code cell. The text cells contain text written in Markdown, which is a simple way to format text. You can edit the text by double clicking on the text cell. To render the text again, press Shift + Enter.

Jupyter Notebook Example of a Jupyter Notebook

1.4 Course setup

During the course we will be introducing concepts in short lectures where we will demonstrate by means of ‘live coding’. This means that we will be writing code in a Jupyter Notebook and explain what we are doing. You can follow along by opening an empty notebook, typing along and running the code yourself. In between the lectures we will provide you with exercises to practice what you have learned.