This lesson requires a premium membership to access.
Premium membership includes unlimited access to all courses, quizzes, downloadable resources, and future content updates.
We will use functions from numpy package to calculate the mean and variance of daily returns. Variance as we know, is the square of standard deviation (Volatility).
1# Calculate Mean and Standard Deviation
2
3import numpy as np
4
5# Daily returns
6
7daily_returns = stock_data['Simple Returns']
8
9# Calculate the mean of daily returns
10Premium membership required
Upgrade to premium to unlock all videos and courses