Solution: Plotting the Moving Averages
Let’s look at the solutions to the above exercise.
We'll cover the following
Task 1: Ploting the moving averages
Analyze the moving averages for these stocks in the year 2008. Then plot the rolling 30 day average against the close price for Encana and CNQ stocks for 2008.
Hint:
pandas.DataFrame.rolling
Provides rolling window calculations.
You can view the sample plot added below and consider the axis.
Get hands-on with 1400+ tech skills courses.