Search for contacts, projects,
courses and publications

Programming in Finance and Economics I


Gruber P.

Course director


The course is structured along computational concepts, not applications.

The topics include

  • The Jupyter Notebook environment and Anaconda
  • Recap of basic Python: variables, types, operators and main commands
  • How computers calculate: floating point numbers
  • Modular programming: User-defined functions and loops
  • Working with data in Python, data sources and data APIs
  • Making use of AI services and service APIs
  • A short introduction to numerical algorithms
  • Random number generation and simple simulations
  • Optimization
  • Finding and installing Python packages and deploying 
  • How to write a successful program or an entire research report in Python
  • Finding errors, improving Python programs and getting help from AI Chatbots



This course requires basic knowledge of a programming language, as specified in the admission criteria to the Master in Finance. For USI bachelor graduates, Informatica I is sufficient. Students from other universities require a similar introduction to programming. Students with little or no programming experience or little experience with Python can follow the Digicamp Bootcamp at start of the semester.


 Many interesting problems in economics and finance can only be solved with the help of the computer, as no analytical solution exist or large amounts of data are involved. This course teaches how to solve quantitative problems with the help of Python, a powerful and widely used open source programming environment.

The course has the following goals:

  • Learn the most important elements of the Python language
  • Understand the differences between analytical and numerical problem solving
  • Learn how to translate mathematical or statistical problems into the Python language
  • Learn how to organize data efficiently with the help of Python
  • Learn how to write efficient and durable Python programs
  • Learn how to interact with cloud services such as OpenAI from Python

After this course, students should be able and confident to use Python independently for project work, courses such as numerical methods or for their master thesis.

Teaching mode

In presence

Learning methods

The course starts with a voluntary three week Digicamp Bootcamp, to allow students with little or no programming experience to catch up. The bootcamp is taught by an USI student in the tradition of the Digicamp, the USI peer-to-peer education platform, see

The course itself is organized in seven blocks of four hours. Each block introduces a new concept and employs learning-by-doing to move from theory to practice. Students start with short online tutorial before each class (flipped classroom). The course block itself starts with a presentation of a new concept. Next, we study a sample R program that illustrates this concept and try to understand the underlying ideas. Students will then train their skills with programming exercises that are submitted to an online system that provides instant feedback.

Students should bring a laptop with Anaconda and Python installed to all classes.

This class is generously supported by Datacamp.

Examination information

10% participation in online tutorials

  • Grading is based on timely completion

10% individual programming exercises during the course phase

  • Grading is based on the correctness of the results and on programming style

80% programming project in small groups, due at the end of the semester

  • Grading is based on four criteria:
    • Completeness and correctness (Does the program work, produce correct results and perform all the tasks required?)
    • Programming style (Is the program written elegantly, efficiently and well documented?)
    • User documentation (Completeness, style)
    • Complexity of the problem and the solution (Are requirements over/under satisfied in a relevant way?)

Usage of AI tools such as ChatGPT is allowed for the programming project, in fact it is assumed that participants use AI help. This will be reflected in the difficulty of the programming projects.