import pandas as pd
%matplotlib inline
If you have installed pandas_datareader
, please download current stock prices using this:
import pandas_datareader.data as web
s = web.DataReader(['AAPL', 'GOOG', 'TSLA'], data_source='yahoo', start='2020')
Alternately, load from a file where data from until yesterday was saved. Download the file from D2L and move it to the right place in order for the following cell to work.
s = pd.read_pickle('../../data_external/stock_prices.pkl')
In either case, you will end up with a data frame s
which contains three categories of prices for three tech stocks.
Tasks:
MultiIndex
) is being used in this data.AAPL
on all days in the data.MultiIndex
containing only TSLA
data.