mrtrieuphong/Stock-prediction-2021

KeyError: 'close'

kau50 opened this issue · 4 comments

kau50 commented

KeyError
KeyError: 'close'

File "D:\stockmarket-prediction-master\app.py", line 25, in requestStock
return predictStock(stockName)
File "D:\stockmarket-prediction-master\app.py", line 13, in predictStock
stockData=stockpredict(stockName)
File "D:\stockmarket-prediction-master\main.py", line 36, in stockpredict
cl = data[data['Name']==stockName]['close']

i am getting this error, how do i fix it?
image

Please check your dataset, ensure that the close column is available.

kau50 commented

yes i verified that close column is available, i have used the dataset provided in the repo. I switched close column from E to F, but that does solve the issue.
image

Can you print(data.head()) and print(data[stockName]) before cl variable?

kau50 commented

this is the output
getting a keyerror:AAPL
image
image
image