...

/

Solution: Oil vs Banks During Recession

Solution: Oil vs Banks During Recession

Let’s look at the solution to the above tasks.

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().

Access this course and 1400+ top-rated courses and projects.