Methods: Python programming for economists

Table of Contents

This website contains the material for the MSc course Methods: Python programming for economists.

This website is under construction for 2026/2027

This year the course is taught by:


Table of Contents


1. Course Material

1.1. Career Development part of the course

Career development activities (workshops and career events) are part of the course ‘Methods: Python Programming’. The goal of this career development part of the course is to help students from the Master Economics transition into their careers after graduation. The focus is on personal growth and development and provides practical tools to be well prepared for the job application process.

In both semester 1 and semester 2, workshop(s) will be offered by Student Career Services. To pass the course ‘Methods: Python Programming’, you must participate in at least 1 workshop of your choice and at least 1 career event. You will receive a partial grade once you have completed the Python programming part of the course. At the end of the academic year, you will be assessed whether you have met the set criteria of the career development part of the course through a pass or fail. Only with a positive grade for the Python programming part of the course and a pass for the career development part of the course you have passed the course ‘Methods: Python Programming’.

For more information and for an overview of workshops and career events offered throughout the year check the ‘Career Development for MSc Economics’ Canvas page and this file.

1.2. Python part

For the Python part of the course, there are three types of materials that we use:

The lectures (mandatory)

The website with the lectures are mandatory. Make sure you read the material before each lecture (see lecture schedule below) and solve the Review Questions at the end of each Lecture.

Learning a programming language requires you to try and program yourself. Just copying the code during the lectures is not going to help you very much; if you are only doing this, it is basically a waste of your time.

The important part of this course you do at home going over the lectures, experimenting with the code and trying to solve the Review Questions. This part will most likely be frustrating because you get errors and you make mistakes (i.e. different results than you would expect) etc. Don’t worry, this is normal when you are learning a programming language!

(Downey 2023) (highly recommended)

The lectures are (loosely) based on Downey (2023) which is a great introduction into Python. The book can be found here and the associated notebooks here. The book sometimes uses “wrappers” around the Python functions that we will be using and it is targeted at engineering students. But it does explain the idea of modelling in Python very well and it gives you an introduction to numpy and scipy functions.

Datacamp (optional)

If you have never done any programming before, the three courses below from Datacamp will help you get up to speed. I recommend that you do these courses before the start of the semester. If you have programmed before or done some Datacamp courses already, this part is optional.

You can get access to Datacamp via the university website.

From Datacamp, you can do the following courses:

These courses teach you the basic Python syntax. In our lectures we use parts of Python more specific to economics; e.g. commands to solve equations, equilibria etc. These parts of the course complement each other. It is not the case that all the Python that we use in the lectures, you will first see in Datacamp but most of it is in Allen Downey’s book.

Most students like Datacamp to get used to Python syntax. A minority of students really dislike Datacamp. If you do not like it either, you can also read Think Python as an introduction to “pure” Python (instead of Downey’s modeling and simulation book, mentioned above). You can buy the book or read the free online version. The jupyter notebooks can be found on github. You can clone this repository and work with the notebooks. You can also find some wonderful presentations on Youtube by the author Allen Downey.

2. Lecture schedule

date time staff room lecture Downney
2026-08-26 12:45-14:30 Joyce Cube 219    
2026-09-01 12:45-14:30 Jan Cube 219 1 1-4
2026-09-08 12:45-14:30 Mery Cube 219    
2026-09-15 12:45-14:30 Jan Cube 217 2 5-8
2026-10-12 12:45-14:30 Joyce Cube 17    
2026-10-14 14:45-16:30 Joyce Cube 213    
2026-10-21 08:45-10:30 Jan CZ 112 3 11-14
2026-10-28 14:45-16:30 Joyce Cube 21    
2026-11-04 12:45-14:30 Joyce E 4 Blackbox    
2026-11-11 08:45-10:30 Jan MKZ 111 4  
2026-11-19 08:45-10:30 Jan MKZ 111 5  
2026-11-25 10:45-12:30 Jan CZ 9 6  
2026-12-02 10:45-12:30 Jan Cube 220 Q&A  
2027-01-04 deadline assignment        
2027-05-10 deadline resit        

2.1. First Lecture

Initial Assignment

Do the following three steps:

  • create a github account on github (you need this account to submit your final assignment)
    • we advise you to do this before Thursday September 25, 2025
  • go to
    • jupyter lab
      • IT suggests that you use the Firefox browser to access jupyter lab
      • sometimes it helps to access jupyter lab with an incognito/private window
      • or –if all else fails– you can use google’s colab
  • create a new python notebook and type the following code in the first cell:
%%bash

git clone https://github.com/janboone/Python-programming-for-economists.git
  • then press the Shift key and Enter key at the same time
  • this creates a folder on the server `Python-programming-for-economists` that contains the material for the course.
  • Note: you can only run this command once. If you run it again, you get an error since the folder already exists.
  • If you want to see the final assignment in jupyter lab, you can also type:
%%bash

git clone https://github.com/janboone/python_assignments
  • create marimo on jupterlab: how-to

2.2. Deadlines

  • The deadline for the final python assignment is: Monday January 4th, 2027.
  • The resit deadline for the python assignment is: Monday May 10th, 2027.
  • Your grade is determined by:
    • a “pass” on the Career Services assignments;
    • final assignment.

Follow the instructions below and on Canvas explaining how to submit an assignment and fill in the google form etc.

Also note the rules for the resit of the final assignment in case you submitted an assignment for the first exam opportunity (you cannot do an app on the same paper/model twice for your assignment).

3. Assignments

For this course there is one final assignment.

Note that you can do the assignment alone or with at max. one other student (i.e. max group size is 2).

3.1. Final Assignment

  • for the deadlines of the final assignment, see 2.2 above

3.2. what we are looking for

The idea of the final assignment is that you report on an economic model in a transparent way that can easily be verified/reproduced by others. Think of yourself in, say, two years time where you work in a company, bank, consultancy firm or a ministry. You need to explain an economic “phenomenon” to your colleagues. Since not all your colleagues are necessarily economists, your goal is to create an interactive (marino) app. With this app, colleagues can figure out themselves how certain parameters affect the outcome and how sensitive outcomes are to (other) parameter values.

Since future colleagues is a bit vague, think of the intended audience as your fellow students. They should be able to understand the code you write together with the explanations that you give for this code and for the economics that you are explaining.

The following ingredients will be important when we evaluate your final assignment:

  • The topic for the app should come from a theory (i.e. not empirical) paper or a theoretical model that you have seen in class for another course
  • Briefly describe what the paper/model does and what the results you want to illustrate with the app
  • When you use information (e.g. a literature reference), create a link to this information. The reader then only needs to click to find the relevant information.
  • Then formulate a clear and transparent research question that the user will be able to answer using the app
  • Briefly motivate why this question is interesting.
  • Use \(\LaTeX\) to introduce and explain the model. Describe the main equations (using \(\LaTeX\)) of the model that you will program in Python.
  • Explain how you move from the analytical equations of the paper to Python code.
  • We will be looking for at the least the following methods in the code:
    • there agents maximizing payoffs; in the Python code use optimization methods
    • Solve for an equilibrium using Python (using fixed points).
    • Use a parameter sweep (and pandas to store the results) to show how the results are affected by parameter values
  • Explain your code in Markdown blocks, not as comments in code blocks
    • and note that these explanations make sense in both the edit and app views of the marimo notebook
  • Present interactive graphs of your simulation results using matplotlib and marimo sliders
  • Discuss what the figures show (e.g. \(x\) is increasing in \(y\)) and explain the economic intuition for this relation (between \(x\) and \(y\)).
  • What can the user learn from the app and the interactive outcomes that follow from it

Remark 1:

  • you can copy code from the web or an LLM; but
    • make sure that you explain the code that you use so that another student of the course understands it and can use it;
    • e.g. if you use functions, libraries that we have not used in the lectures you need to explain these in your notebook
    • but there is no need to explain what np.arange does: we use this extensively in class
    • give the reference of the code that you copy or acknowledge the use of an LLM
    • check the code and explain the economics of your results yourself; do not rely on the LLM only.

Remark 2:

  • the apps we create in the lectures do actually not satisfy the criteria for the final assignment:
  • either there is no optimization problem that is solved with python (e.g. in the Cournot example we derived the reaction functions analytically)
  • or there is no equilibrium derived like in the Solow model app
  • the app based on the gender economics lecture does have all the elements that we are looking for in the final assignment

3.3. resit of final assignment

The resit of the final assignment needs to start from a new paper/model compared to the one you handed in before. Simply adjusting your first submission based on our feedback will be not be enough.

Otherwise, follow the procedure above on how to submit the assignment and fill in the google form.

4. Bibliography

Downey, Allen B. 2023. Modeling and Simulation in Python: An Introduction for Scientists and Engineers. San Francisco, CA: No Starch Press.

Author: Jan Boone

Validate