A project-based Python laboratory for finance, mathematics, economics, and energy & commodities.
The repository is no longer organised as a collection of disconnected micro-exercises. The 00_cheatsheets/ and 00_problem_sets/ folders remain the technical training area. Everything after them is organised around complete problems that require modelling, research, clean Python, interpretation, and communication.
00_cheatsheets/ Syntax and concepts to consult quickly
00_problem_sets/ Short exercises for Python fundamentals
01_finance/ Portfolio, pricing, risk, and backtesting projects
02_mathematics/ Numerical methods, probability, calculus, and linear algebra
03_economics/ Inflation, growth, debt, exchange rates, and policy analysis
04_energy_commodities/ Oil, gas, LNG, power markets, and commodity risk
Every project should contain:
- a real question;
- assumptions and definitions;
- a mathematical model;
- a Python implementation;
- input validation and tests;
- tables or charts when useful;
- interpretation of the results;
- limitations and possible extensions;
- a short written conclusion.
The objective is not only to obtain a number. It is to understand what the number means, when the model works, and when it can fail.
For each project:
Research -> Plan -> Build -> Test -> Interpret -> Improve -> Document
Recommended workflow:
- Read the project brief completely.
- Research any unfamiliar finance, mathematical, economic, or energy concepts.
- Write the formulas and assumptions before coding.
- Divide the project into small functions.
- Start with a simple working version.
- Add validation, tests, and edge cases.
- Explain the results in your own words.
- Commit meaningful milestones rather than one huge final commit.
- Level 1 — Builder: clean functions, loops, dictionaries, files, and basic calculations.
- Level 2 — Analyst: NumPy/pandas, statistical reasoning, charts, tests, and interpretation.
- Level 3 — Researcher: external data, model comparison, sensitivity analysis, and a written report.
A project is complete only when the core requirements are satisfied. The extensions are optional and can be revisited later.
01_finance/01_portfolio_account_engine
02_mathematics/01_monte_carlo_probability_lab
03_economics/01_inflation_and_purchasing_power
04_energy_commodities/01_oil_revenue_scenario_engine
Then continue with the remaining projects in each group according to your interests.
By completing the repository, you should be able to:
- translate a real problem into variables, assumptions, and formulas;
- build reusable Python functions rather than one-off scripts;
- work with financial and economic data;
- simulate uncertainty and analyse risk;
- explain quantitative results clearly;
- produce portfolio-ready projects aligned with quantitative finance, macroeconomics, and commodities.
The repo should function as a serious preparation ground for larger work such as a portfolio risk engine, Monte Carlo option pricing, sovereign-risk analysis, commodity scenario models, and a simple systematic trading research platform.