This folder contains Jupyter notebooks that accompany the Financial Theory with Python book and slide decks in the CPF Program (https://python-for-finance.com). The notebooks reproduce the main derivations, pricing examples, and numerical experiments presented in class, and they are designed to run smoothly in Google Colab or a local Python environment.
The notebooks follow the structure of the book Financial Theory with Python by Dr. Yves J. Hilpisch. The book develops modern asset pricing concepts — such as state-price vectors, stochastic discount factors, and no-arbitrage pricing — and demonstrates them with concise, executable Python code.
Each chapter notebook mirrors the code from that chapter:
ftwp_chapter_01.ipynb— historical context and the role of Python in financeftwp_chapter_02.ipynb— two-state economy and static arbitrageftwp_chapter_03.ipynb— three-state economy and incomplete marketsftwp_chapter_04.ipynb— preferences, utility, and consumption-based asset pricingftwp_chapter_05.ipynb— dynamic models, binomial trees, and option pricingftwp_chapter_06.ipynb— Monte Carlo methods and more advanced pricing examples
To get started, open a notebook in Google Colab or your preferred Jupyter environment, run the cells from top to bottom, and compare the results with the corresponding chapters and slide decks.
It is often convenient, to install the "Open in Colab" Chrome extension which lets you open notebooks in Colab directly from the GitHub repository.
This repository and its contents are provided for educational and illustrative purposes only and come without any warranty or guarantees of any kind—express or implied. Use at your own risk. The authors and The Python Quants GmbH are not responsible for any direct or indirect damages, losses, or issues arising from the use of this code. Do not use the provided examples for critical decision‑making, financial transactions, medical advice, or production deployments without rigorous review, testing, and validation.
Some examples may reference third‑party libraries, datasets, services, or APIs subject to their own licenses and terms; you are responsible for ensuring compliance.
- Email: team@tpq.io
- Linktree: https://linktr.ee/dyjh
- CPF Program: https://python-for-finance.com
- The AI Engineer: https://theaiengineer.dev
- The Crypto Engineer: https://thecryptoengineer.dex

