Introduction to Python for Finance
Adina Howe
Instructor
Standard and Poor's S&P 100:
Sectors of Companies within the S&P 100 in 2017
$$ \text{Price to earning ratio} = \frac{\text{Market price}}{\text{Earnings per share}} $$
Lists of data describing the S&P 100: names, prices, earnings, sectors
Explore and analyze the S&P 100 data, specifically the P/E ratios of S&P 100 companies
In [1]: my_list = [1, 2, 3, 4, 5]
# first element
In [2]: print(my_list[0])
1
# last element
In [3]: print(my_list[-1])
5
# range of elements
In [4]: print(my_list[0:3])
[1, 2, 3]
# Convert lists to arrays
import numpy as np
my_array = np.array(my_list)
# Elementwise array operations
array_ratio = array1 / array2
Introduction to Python for Finance