From 43c90a58330123d00c1b44fecbb25711e0f99b0b Mon Sep 17 00:00:00 2001 From: Jeremiah Saunders Date: Thu, 8 May 2025 20:05:29 -0500 Subject: [PATCH] The 'Avg Close' key does not exist, resulting in an error. Replacing it with the 'Close' key works, and it should have the same effect. --- 03-return_of_a_portfolio_of_securities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/03-return_of_a_portfolio_of_securities.py b/03-return_of_a_portfolio_of_securities.py index 9491547..d1d4f76 100644 --- a/03-return_of_a_portfolio_of_securities.py +++ b/03-return_of_a_portfolio_of_securities.py @@ -10,7 +10,7 @@ # Get the historical data for each stock and add it to the dataframe for t in tickers: - mydata[t] = yf.download(t, start='2023-01-01', end='2023-05-11')['Adj Close'] + mydata[t] = yf.download(t, start='2023-01-01', end='2023-05-11')['Close'] # Print the dataframe information print(mydata.info())