Stock Market and Portfolio Anaylsis of the S&P 500 with pandas and quandl
This post includes code adapted from python for finance and trading algorithms udemy course and python for finance and trading algorithms udemy course notebooks.
import pandas as pd
import quandl
start = pd.to_datetime('2010-01-01')
end = pd.to_datetime('today')
SP500 = quandl.get("MULTPL/SP500_REAL_PRICE_MONTH",start_date = start,end_date = end)
SP500.head()
SP500.tail()
import matplotlib.pyplot as plt
%matplotlib inline
SP500['Value'].plot(figsize = (12, 8))
plt.title('Total S&P 500 from 2010 to 2020 Value')