About the course

About the teachers of this course

This course was designed by Thomas Robitaille who gave this course for many years at the Heidelberg University. Due to the popularity of this course we now offer several block courses in parallel. Dr. Robitaille has moved on to another job so this course is now given by other teachers. This semester group 3 is given by Prof. Cornelis Dullemond (CIP Phil 12)

We will use the Uebungsgruppenverwaltungssystem to administer this course:


This is in fact the place where you have already registered.

This web page is meant only for group 3. My name is Cornelis ("Kees") Dullemond and I will be your teacher. My email address is dullemond@uni-heidelberg.de. The lecture will be in fact mostly based on exercises and will be very interactive.

Lecture schedule: 9:00 (st!) - 14:30 main lecture + exercises. And from 14:30 - 17:00 time for finishing homework. I will be there for questions most of the time.


Please let me know if you have feedback/suggestions for improving the course!

At any point during the course, you can fill out this form to give 'live' feedback:



  • Using the IPython Notebook
  • Introduction to Python
  • Modules and Functions
  • Introduction to Numpy and Matplotlib
  • Reading/writing data from files
  • Introduction to Scipy (interpolation, integration, fitting)
  • Object-oriented programming
  • Applying Python to scientific problems


The block course lasts five days, and each day will follow this schedule:

  • 9:00-10:30 - lecture/exercises
  • 10:30-11:00 - break
  • 11:00-12:30 - lecture/exercises
  • 12:30-13:30 - break for lunch
  • 13:30-14:30 - lecture/exercises
  • 14:30-17:00 - computer pool available to finish homework

The lectures will be mixed with exercise sessions - from time to time I will give you 5 or 10 minutes to complete a given task/exercise. I will give out three graded problem sets during the week, and you will be required to hand these in a deadline indicated on the problem sheet. There will be no final exam. An average of 60% in the problem sets will be required to obtain the 2 credits at the end of the course.

The course will be in English.

I am very happy to come by to review your code/solutions to exercises (i.e. not problem sets, at least not until they are handed in). During the afternoon session, please do ask me to come by if you would like me to comment on your code and how to improve it.


All solutions should be submitted as an IPython notebooks (one notebook per problem set). Please enter a filename that contains the name of the problem sheet and your name, and ending with .ipynb, as follows:


Send the file by email to dullemond@uni-heidelberg.de with [PY4SCI] in the subject.

The following criteria are taken into account for grading problem sets - the notebook should:

  • run with no errors
  • produce the correct results
  • be clearly readable, and include text to explain what you are doing and why
  • not include any unused code!
  • be well presented! :)

Please make use of the ability to add text around your code in the notebook. Make it so that someone not familiar with the problem could read through it and understand your solution.

There is not always a unique solution to a problem, so it does not matter if your programs do not look the same as somebody else's! What matters most is that you find your own way of doing it.

Policy on handing in solutions

Practice Problems can be done in groups, but Problem Sets should be done individually in order to get the full marks. If you need to work with someone else, then you can, but (a) you should submit a single solution and declare that you worked together on the solution, and (b) the final grade for the problem set will be multiplied by 0.75. If two students or more submit essentially the same solution without declaring they have worked together, then the final grade for the problem set will be multiplied by 0.50 :)


If you would like to use Python on your laptop, you have several possibilities:

  • If you have a linux laptop and are familiar with package managers, most major scientific Python packages are available through these
  • Otherwise, try and install the Anaconda Python distribution

Come and speak to me in the afternoon if you have any questions or need any help getting set up.

Getting set up

Lecture Notes

The lecture notes in notebook format can be downloaded from the main lecture course page. Note that you can unzip files with:

unzip py4sci_mon.zip

CIP Pool

Before you can run Python in the ways described on this page, you will need to start up a command-line Terminal application. In the CIP pool this is located in the Anwendungen -> Zubehör -> Terminal menu.

If you are using the CIP machines, you will need to add a line to your .bashrc file to enable the Anaconda Python distribution. You can run:

echo "export PATH=/local/py4sci/anaconda3/bin:\$PATH" >> ~/.bashrc