Skip to content

Errors while running comp.py  #285

@Jinyoung6177

Description

@Jinyoung6177

Hi everyone, I wanna run comp.py. I tried with $python, $python3, and $python3.6 to run the file but I get errors.

I have proper environment for running urbs already. Panda = 0.24.2, pyutilib =5.8.0 etc.
Could you help me tackle this errors? Thanks a lot!

Below is with python3:
(base) yunjin-yeong-ui-MacBook-Air:~ YUNJINYOUNG$ conda activate urbs
(urbs) yunjin-yeong-ui-MacBook-Air:~ YUNJINYOUNG$ cd ~/urbs-master
(urbs) yunjin-yeong-ui-MacBook-Air:urbs-master YUNJINYOUNG$ python3 comp.py
File "/Users/YUNJINYOUNG/urbs-master/comp.py", line 15
def get_most_recent_entry(Users\YUNJINYOUNG\urbs-master\Input):
SyntaxError: unexpected character after line continuation character
(urbs) yunjin-yeong-ui-MacBook-Air:urbs-master YUNJINYOUNG$ python3 comp.py
Traceback (most recent call last):
File "/Users/YUNJINYOUNG/urbs-master/comp.py", line 259, in <module>
compare_scenarios(list(reversed(result_files)), comp_filename)
File "/Users/YUNJINYOUNG/urbs-master/comp.py", line 135, in compare_scenarios
esum.set_index(['level_0', 'level_1'], inplace=True)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/core/frame.py", line 4555, in set_index
raise KeyError(f"None of {missing} are in the columns")
KeyError: "None of ['level_0', 'level_1'] are in the columns"

And with python3.6:
(urbs) yunjin-yeong-ui-MacBook-Air:urbs-master YUNJINYOUNG$ python3.6 comp.py Traceback (most recent call last):
File "/Users/YUNJINYOUNG/opt/anaconda3/envs/urbs/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2657, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'level_0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "comp.py", line 259, in <module>
compare_scenarios(list(reversed(result_files)), comp_filename)
File "comp.py", line 135, in compare_scenarios
esum.set_index(['level_0', 'level_1'], inplace=True)
File "/Users/YUNJINYOUNG/opt/anaconda3/envs/urbs/lib/python3.6/site-packages/pandas/core/frame.py", line 4178, in set_index
level = frame[col]._values
File "/Users/YUNJINYOUNG/opt/anaconda3/envs/urbs/lib/python3.6/site-packages/pandas/core/frame.py", line 2927, in __getitem__
indexer = self.columns.get_loc(key)
File "/Users/YUNJINYOUNG/opt/anaconda3/envs/urbs/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2659, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'level_0'

Lastly, with python:
(urbs) yunjin-yeong-ui-MacBook-Air:urbs-master YUNJINYOUNG$ python comp.py
Traceback (most recent call last):
File "/Users/YUNJINYOUNG/opt/anaconda3/envs/urbs/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2657, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'level_0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "comp.py", line 259, in <module>
compare_scenarios(list(reversed(result_files)), comp_filename)
File "comp.py", line 135, in compare_scenarios
esum.set_index(['level_0', 'level_1'], inplace=True)
File "/Users/YUNJINYOUNG/opt/anaconda3/envs/urbs/lib/python3.6/site-packages/pandas/core/frame.py", line 4178, in set_index
level = frame[col]._values
File "/Users/YUNJINYOUNG/opt/anaconda3/envs/urbs/lib/python3.6/site-packages/pandas/core/frame.py", line 2927, in __getitem__
indexer = self.columns.get_loc(key)
File "/Users/YUNJINYOUNG/opt/anaconda3/envs/urbs/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2659, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'level_0'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions