transit-timing / tt

TESS Transit Timing of 278 Planets
0 stars 1 forks source link

error with pandas #1

Open svaverbe opened 1 year ago

svaverbe commented 1 year ago

The python code returns a key error with pandas:

python main.py Traceback (most recent call last): File "/home/siegfried/anaconda3/envs/science/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3080, in get_loc return self._engine.get_loc(casted_key) File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 4554, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 4562, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'T0 (BJD TDB)'

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

Traceback (most recent call last): File "main.py", line 41, in main() File "main.py", line 23, in main t0 = ephemerides[(ephemerides['System'].str.upper() == planet_name.upper())]['T0 (BJD TDB)'].iloc[0] File "/home/siegfried/anaconda3/envs/science/lib/python3.8/site-packages/pandas/core/frame.py", line 3024, in getitem indexer = self.columns.get_loc(key) File "/home/siegfried/anaconda3/envs/science/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3082, in get_loc raise KeyError(key) from err KeyError: 'T0 (BJD TDB)'

LilyWendy commented 4 months ago

To fix this error, just change file "main.py", line 17: ephemerides = pd.read_csv(direct + '/3_database/table4.csv') ==> ephemerides = pd.read_csv(direct + '/3_database/table3.csv')

"table4.csv" ==> "table3.csv"