Get startedGet started for free

Introducing the dataset

1. Introducing the dataset

Let's review the concepts you've learned thorughout this course.

2. Overall Review

The course started with an introduction to the Python shell and scripts and moved on to variables and data types in Python. Then the course focused on lists and NumPy arrays, and methods and functions associated with them. You also saw how to subset and filter both lists and arrays. Finally, we showed you how to use the pyplot module of matplotlib to generate plots in Python.

3. S&P 100 Companies

For the final chapter of this course, you're going to use what you've learned about Python to conduct a financial analysis of stocks for the companies in the Standard and Poor's S&P 100. The S&P 100 is a stock market index made up of one hundred major companies in the United States that span multiple industries.

4. S&P 100 Case Study

Within the S&P 100, companies are associated with specific sectors. For example, the largest sector is made up of companies associated with the consumer discretionary sector. These include companies like Amazon.com and Nike. The next largest sectors are information technology, healthcare, and financial sectors. In this case study, we'll be analyzing all the S&P 100 companies as well as sector specific companies.

5. The data

For each company, we have data on its name, sector, stock price, and earnings per share, abbreviated EPS. The earnings per share is the profit for each share of stock. Our objective for the first part of our case study is to analyze growth expectations of companies within the S&P 100 by calculating the price to earnings ratio of each company.

6. Price to Earnings Ratio

You may remember from the previous exercises that the price to earnings ratio is used to measure growth expectations of stocks. It is the dollar amount you can expect to invest in a company in order to receive one dollar of the company's earnings. Mathematically, it is the price per stock share divided by its earnings per share. A higher P/E ratio is generally associated with higher growth expectations.

7. Your mission

In this case study, you will be given four lists associated with the S&P 100 companies incuding their names, stock prices, earnings per share, and the sectors. The first part of this case study will ask you to explore the data that is provided and to calculate the price to earnings ratio for each company.

8. Step 1: examine the lists

To accomplish this task, you'll want to recall several topics we discussed in the past lessons. The case study data is provided as lists. Remember that you can subset specific elements of a list with indexing and slicing.

9. Step 2: Convert lists to arrays

Next, you'll want to calculate the price to earnings ratio by dividing the price by earnings. This division is an elementwise operation and is best done with python arrays. Your next step will thus be to convert lists of prices and earnings to arrays. Remember that python packages, like NumPy, provide access to many useful functions. You can convert lists to arrays with the function array() with numpy.

10. Step 3: Elementwise array operations

Once you have arrays, you can perform elementwise operations, like dividing two arrays very easily as shown here.

11. Let's analyze!

Now that we've reviewed some concepts, let's go complete part one of your mission!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.