Get startedGet started for free

The effect of diversification

In this exercise you're going to compare performance of four individual stocks, to a portfolio of the same four stocks. You'll see that 2 out of the four stocks will under-perform over a time period of roughly four years, and two will perform quite well.

The stocks you're going to investigate are General Electric, JP Morgan, Microsoft and Proctor & Gamble.

Let's play a little game: pick one stock to invest in, then, let's see how it would have performed over time. There's a 50-50 chance that you'll pick a winning stock, versus a losing stock. Let's look at the data and see whether your stock is one of strong performers.

Available is a data set called stock_returns containing the cumulative returns of these four stocks over time, plus a portfolio of these stocks.

This exercise is part of the course

Introduction to Portfolio Analysis in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Check beginning and end of dataset
print(stock_returns.____())
print(stock_returns.____())
Edit and Run Code