Solution: Oil vs Banks During Recession

Task 1: Combining all datasets

Combine all the bank (RBC, CIBC, BMO) and oil company (Suncor, Encana, CNQ) datasets into a single dataset ‘bo’ (‘b’ for bank and ‘o’ for oil) and check the head of the dataset.

Hint: Use tickers = ['RBC', 'CIBC', 'BMO', 'Suncor', 'Encana','CNQ'] to add a hierarchical index at the outermost level of the data with the keys option in pd.concat().

Get hands-on with 1200+ tech skills courses.