Question: Could you please show me what is wrong with my code and show me the correct code for this syntax error? I am trying to

Could you please show me what is wrong with my code and show me the correct code for this syntax error? I am trying to answer the second part of the question

 

Could you please show me what is wrong with my code and

Image transcription text

Task 1 Read in each of the CSV files for the S&P 100 stocks in a dictionary for us to easily reference and manipulate the data. . Start by reading in the companies and their stock ticker symbols into a dataframe called sp100 , with the "Ticker" column as the index. . Next, create a dictionary called stock_frames . This will serve as a container to store all the historical price data for the component stocks. . Read in the historical price data for all stocks in sp100 as dataframes and store them in stock_frames with the stock's ticker as the key. . For this project, we will only need the columns "Date" and "Adj Close" so limit to just these two columns when reading in the CSV file, with the "Date" column as the dataframe's index. Hint: When reading in the CSV files, you may want to use a loop to iterate the index of *sp100* that was created earlier. 1]: sp100 = pd. read_cav('C:/Users/bwoods/OneDrive - Berkadia/Desktop/Python/Week 6 Project/SP100 (4)/SP100/_SP160. cav', usecols = ['7 sp100 = sp100. squeeze ( ): stock_frames = {} for ticker in sp100: stock_frames [ticker] = pd. read_cav('C:/Users/bwoods/OneDrive - Berkadia/Desktop/Python/Week 6 Project/SP100 (4)/SP100/{ticker index_col ='Date', usecols = ['Date' , 'Adj Close' ]) stock_frames FileNotFoundError Traceback (most recent call last) Cell In [53], line 3 1 stock_frames = {} 2 for ticker in sp100: - -> 3 stock_frames [ticker] = pd. read_cav('C:/Users/bwoods/OneDrive - Berkadia/Desktop/Python/Week 6 Project/SP100 (4)/SP1 00/ {ticker} . cav' , \ index_col ='Date', usecols = ['Date', 'Adj Close' ]) 5 stock_frames

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!