Solution: Plotting the Moving Averages

Let’s look at the solutions to the above exercise.

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 1200+ tech skills courses.