'What can be the possible solution to the error message below

C:\Users\Sarthak\miniconda3\python.exe C:/Users/Sarthak/PycharmProjects/pythonProject3/Portfolio-Optimization-Multiple-Hypothesis-Testing.py

Traceback (most recent call last): File "C:\Users\Sarthak\miniconda3\lib\site-packages\pandas\core\indexes\base.py", line 3361, in get_loc return self._engine.get_loc(casted_key) File "pandas_libs\index.pyx", line 76, in pandas._libs.index.IndexEngine.get_loc File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc File "pandas_libs\hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas_libs\hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 0

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:/Users/Sarthak/PycharmProjects/pythonProject3/Portfolio-Optimization-Multiple-Hypothesis-Testing.py", line 263, in mpoptmpvalf1 = (mpoptmtstatf10, mpoptmtstatf11, mpoptmtstatf12, mpoptmtstatf13, mpoptmtstatf14) File "C:\Users\Sarthak\miniconda3\lib\site-packages\pandas\core\frame.py", line 3458, in getitem indexer = self.columns.get_loc(key) File "C:\Users\Sarthak\miniconda3\lib\site-packages\pandas\core\indexes\base.py", line 3363, in get_loc raise KeyError(key) from err KeyError: 0

Process finished with exit code 1



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source