warriorsam53
Elite Member
- Jan 15, 2016
- 2,221
- 2,639
Hi, can you check the below and tell me what is happening?
Traceback (most recent call last):
File "C:\xxx\xxx\xxx\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\core\indexes\base.py", line 3803, in get_loc
return self._engine.get_loc(casted_key)
File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas\_libs\index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
File "pandas\_libs\hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas\_libs\hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'topic'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\xx\xx\xx\xx\Desktop\AI\aii.py", line 13, in <module>
prompt = f"Please write a detailed article about {row['topic']}. Use this information to write the article: {row['context']}"
File "C:\xx\xx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\core\series.py", line 981, in __getitem__
return self._get_value(key)
File "C:\xx\xx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\core\series.py", line 1089, in _get_value
loc = self.index.get_loc(label)
File "C:\xx\xx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\core\indexes\base.py", line 3805, in get_loc
raise KeyError(key) from err
KeyError: 'topic'
I’m not sure tbh.
Is your input file as per the instructions? Any funky characters in it?
Maybe someone else can chime in and help you out.