This course introduces programming through Python, starting with Jupyter Notebooks, Python 3 basics, variables, data types, loops, and functions before moving into finance-focused applications. You’ll learn to calculate returns, analyze risks, measure diversification, and apply regression models for metrics like alpha and beta. Using finance libraries and real datasets, you’ll explore advanced tools such as Markowitz Portfolio Optimization, CAPM, and Monte Carlo simulations to build efficient frontiers, compute Sharpe ratios, and model asset prices. By combining coding fundamentals with practical finance techniques, the course equips you with the skills to bridge data science and financial analysis for real-world applications.
Who should take the course?
This course is ideal for students, beginners, and professionals who want to develop data analytics skills using Python. It’s well-suited for those with little to no prior experience in data analysis who are eager to learn how to work with data, generate insights, and apply Python libraries for real-world problems. Whether you’re an aspiring data analyst, a researcher, or a professional aiming to make data-driven decisions, this course will equip you with practical knowledge to analyze and interpret data effectively with Python.
What you will learn
Write Python code for data analysis and financial modeling
Clean, structure, and visualize financial data
Calculate and interpret returns, volatility, and portfolio risk
Perform and evaluate regression analyses on investment data
Simulate asset prices using Monte Carlo methods
Optimize portfolios using Markowitz theory and CAPM principles
Course Outline
Welcome! Course Introduction
What Does the Course Cover?
Introduction to Programming with Python
Programming Explained in 5 Minutes
Why Python?
Why Jupyter?
Installing Python and Jupyter
Jupyter's Interface – the Dashboard
Jupyter's Interface – Prerequisites for Coding
Python 2 vs Python 3: What's the Difference?
Python Variables and Data Types
Variables
Numbers and Boolean Values
Strings
Introduction to Anaconda AI
Using the Anaconda Assistant: Strings
Basic Python Syntax
Arithmetic Operators
The Double Equality Sign
Reassign Values
Add Comments
Line Continuation
Indexing Elements
Structure Your Code with Indentation
Python Operators Continued
Comparison Operators
Logical and Identity Operators
Conditional Statements
Introduction to the IF statement
Add an ELSE statement
Else if, for Brief – ELIF
A Note on Boolean Values
Python Functions
Defining a Function in Python
Creating a Function with a Parameter
Another Way to Define a Function
Using a Function in another Function
Combining Conditional Statements and Functions
Creating Functions Containing a Few Arguments
Notable Built-in Functions in Python
Python Sequences
Lists
Using Methods
List Slicing
Tuples
Dictionaries
Using Iterations in Python
For Loops
While Loops and Incrementing
Create Lists with the range() Function
Use Conditional Statements and Loops Together
All In – Conditional Statements, Functions, and Loops
Using the Anaconda Assistant: Several Python Tools
Iterating over Dictionaries
Using the Anaconda Assistant: Dictionaries
Advanced Python Tools
Object Oriented Programming
Modules, Packages, and the Standard Library
Importing Modules
Must-have packages for Finance and Data Science
Working with arrays
Generating Random Numbers
A Note on Using Financial Data in Python
Sources of Financial Data
Accessing the Notebook Files
Importing and Organizing Data in Python – Part I
Importing and Organizing Data in Python – Part II.A
Importing and Organizing Data in Python – Part II.B
Importing and Organizing Data in Python – Part III
Changing the Index of Your Time-Series Data
Restarting the Jupyter Kernel
PART II FINANCE – Calculating and Comparing Rates of Return in Python
Considering both risk and return
What are we going to see next?
Calculating a security's rate of return
Calculating a Security's Rate of Return in Python – Simple Returns – Part I
Calculating a Security's Rate of Return in Python – Simple Returns – Part II
Calculating a Security's Return in Python – Logarithmic Returns
What is a portfolio of securities and how to calculate its rate of return
Calculating a Portfolio of Securities' Rate of Return
Popular stock indices that can help us understand financial markets
Calculating the Indices' Rate of Return
PART II FINANCE – Measuring Investment Risk
How do we measure a security's risk?
Calculating a Security's Risk in Python
The benefits of portfolio diversification
Calculating the covariance between securities
Measuring the correlation between stocks
Calculating Covariance and Correlation
Considering the risk of multiple securities in a portfolio
Calculating Portfolio Risk
Understanding Systematic vs. Idiosyncratic risk
Calculating Diversifiable and Non-Diversifiable Risk of a Portfolio
PART II FINANCE – Using Regressions for Financial Analysis
The fundamentals of simple regression analysis
Running a Regression in Python
Are all regressions created equal? Learning how to distinguish good regressions
Computing Alpha, Beta, and R Squared in Python
PART II FINANCE – Markowitz Portfolio Optimization
Markowitz Portfolio Theory - One of the main pillars of modern Finance
Obtaining the Efficient Frontier in Python – Part I
Obtaining the Efficient Frontier in Python – Part II
Obtaining the Efficient Frontier in Python – Part III
PART II FINANCE – The Capital Asset Pricing Model
The intuition behind the Capital Asset Pricing Model (CAPM)
Understanding and calculating a security's Beta
Calculating the Beta of a Stock
The CAPM formula
Calculating the Expected Return of a Stock (CAPM)
Introducing the Sharpe ratio and how to put it into practice
Obtaining the Sharpe ratio in Python
Measuring alpha and verifying how good (or bad) a portfolio manager is doing
PART II FINANCE – Multivariate Regression Analysis
Multivariate regression analysis - a valuable tool for finance practitioners
Running a multivariate regression in Python
PART II FINANCE – Monte Carlo Simulations as a Decision-Making Tool
The essence of Monte Carlo simulations
Monte Carlo applied in a Corporate Finance context
Monte Carlo: Predicting Gross Profit – Part I
Monte Carlo: Predicting Gross Profit – Part II
Forecasting Stock Prices with a Monte Carlo Simulation