Python Forum
How would I go about this error? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How would I go about this error? (/thread-33038.html)



How would I go about this error? - stylingpat - Mar-24-2021

Output:
Exception in thread Thread-4: Traceback (most recent call last): File "C:\Users\zenfi\AppData\Local\Programs\Python\Python39\lib\threading.py", line 954, in _bootstrap_inner self.run() File "C:\Users\zenfi\AppData\Local\Programs\Python\Python39\lib\threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "C:\Users\zenfi\OneDrive\Desktop\Everything Else\Python\3 Candles\3.4.py", line 283, in liveTimer modelLive(app) File "C:\Users\zenfi\OneDrive\Desktop\Everything Else\Python\3 Candles\3.4.py", line 236, in modelLive df = dataDataframe(app,tickers,ticker) File "C:\Users\zenfi\OneDrive\Desktop\Everything Else\Python\3 Candles\3.4.py", line 106, in dataDataframe df = pd.DataFrame(TradeApp_obj.data[symbols.index(symbol)]) KeyError: 0
Where should I start to look? I've been trying to google it, but the examples are over my head


RE: How would I go about this error? - jefsummers - Mar-24-2021

Start at the bottom most line. You are creating a dataframe from TradeApp_obj.data and it is causing a key error. Look at that data and hopefully will be obvious.