Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Python for Finance: The Essential Packages
New
Rating: 5.0 out of 5(1 rating)
67 students

Python for Finance: The Essential Packages

Decimal, NumPy, pandas, SciPy, statsmodels, Polars, Pydantic, FastAPI and pytest, on one portfolio, with code that runs
Created byStephen Leonard
Last updated 10/2026
English
English

What you'll learn

  • Choose the right Python package for each finance task, from storing money to serving an API
  • Store and round money correctly with Decimal, and handle market times across time zones
  • Compute returns, volatility, value at risk and beta with NumPy, pandas, SciPy and statsmodels
  • Validate trades with Pydantic and serve a tested portfolio valuation with FastAPI
  • Avoid the traps that cost money: float drift, pandas 3.0 copy-on-write, naive time zones

Course content

8 sections • 27 lectures • 1h 8m total length
  • Welcome: who this course is for, how it's built1:48
  • The stack at a glance: which package for which job2:21
  • Setup: Python 3.14, a virtual environment, pinned packages, the course data2:04

Requirements

  • You can write and run basic Python: functions, lists, dictionaries, imports
  • Python 3.14 installed, or willingness to install it (lecture 0.3 shows how)

Description

This course contains the use of artificial intelligence.

You already write Python. This course is a guided tour of the packages finance developers use every day: which package does which job, the calls you will use most, and the traps that cost real money.

What's covered:

  • Money and time in the standard library: why float is wrong for money, Decimal and rounding rules, time zones with zoneinfo

  • NumPy: vectorised returns, compounding, annualising, and a seeded Monte Carlo simulation

  • numpy-financial: net present value, internal rate of return and loan payments

  • pandas: loading prices, resampling, rolling volatility, joining positions to prices, and the pandas 3.0 changes that break old code

  • SciPy: value at risk, implied volatility with a root finder, and a minimum-variance portfolio with constraints

  • statsmodels: estimating a stock's beta with a regression

  • Matplotlib charts, the same pipeline in Polars, and a Streamlit dashboard

  • Pydantic and FastAPI: validating trades and serving a portfolio valuation as a web API

  • pytest: testing money exactly and floats approximately

How it's built:

  • One running example: a small portfolio of made-up stocks with synthetic prices. No real market data, and nothing here is investment advice.

  • Every claim comes from the package's official documentation for the pinned version. Every code sample was run on Python 3.14 with those versions, and every "this is an error" claim was checked against the real error message.

  • Short lectures, one idea per slide, with captions on every lecture.

Narration: the voice-over is AI-generated (text-to-speech), checked for correct pronunciation of every technical term.

This course is not affiliated with or endorsed by the Python Software Foundation or any package's maintainers. "Python" is a registered trademark of the Python Software Foundation.

Who this course is for:

  • Python developers working in, or moving into, banking, asset management or fintech
  • Analysts who want to know which package to reach for, and why