This lesson requires a premium membership to access.
Premium membership includes unlimited access to all courses, quizzes, downloadable resources, and future content updates.
Ask questions about this lesson and get instant answers.
We'll use matplotlib package to create a histogram for simple returns to visualize the distribution.
1import matplotlib.pyplot as plt
2
3discrete_returns = stock_data['Simple Returns (%)']
4
5# Drop the missing values
6
7discrete_returns = discrete_returns.dropna()
8
9# Plot the distribution of simple returns
10
11plt.figure(figsize=(14, 7))
12
13plt.subplot(1, 2, 1) # 1 row, 2 columns, first plot
14Premium membership required
Upgrade to premium to unlock all videos and courses