Solution: Oil vs Banks During Recession
Explore techniques to combine multiple stock datasets for banks and oil companies using Python's pandas library. Learn to assign meaningful column names and perform key analysis to find maximum and minimum closing prices. This lesson helps you build skills in data merging, cleaning, and exploratory analysis with financial data during a 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 ...