Texts: For the following questions, the files sp500.csv and prices.csv are provided, which contain a list of stocks in the S&P 500 and certain data about each. For the constituent data, Symbol is a unique key column. For the prices data, Symbol and Date together uniquely define a row. I just need the Python code for the following questions.
a) Use read_csv() to load two files, sp500.csv and prices.csv, each into their own DataFrame.
b) Rotate data: Transform the data organization for the price DataFrame, so prices for each date are each in their own dated column. For example, price-20201031, price-20200930, and so on.
c) Join data: Use join() to combine the constituents data and rotated price data from part (b) into one DataFrame. The resulting DataFrame should have one row for each row in the constituents data.
d) Augment data: Add a column that is the difference between the price on the last available date and the price on the prior available date.
e) Missing values: Determine which stocks do not have price data.