mrtrieuphong / Stock-prediction-2021

This is a tutorial for how to build a recurrent neural network using Tensorflow to predict stock market prices.
0 stars 2 forks source link

KeyError: 'close' #3

Open kau50 opened 1 year ago

kau50 commented 1 year ago

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

mrtrieuphong commented 1 year ago

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

kau50 commented 1 year ago

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

mrtrieuphong commented 1 year ago

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

kau50 commented 1 year ago

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