1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Portfolio Analysis in Python

Exercise

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.

Instructions 1/3

undefined XP
    1
    2
    3
  • Inspect the data stored under stock_returns. Check for which time period we have data on the stocks in the dataset by using the commands .head() and .tail().