AbertayMachineLearningGroup/MQTT_ML

KeyError: "[('timestamp', 'src_ip', 'dst_ip')] not found in axis"

CaptainSparrow17 opened this issue · 1 comments

Hello, Hanan Hindy. Thank you for publishing a fantastic paper and the data set. I am having the following error when running the code in mode 0. Can you please help me to rectify this error?

Starting Slice #: 0
Start Classification
Traceback (most recent call last):
File "/home/kali/Desktop/./classification.py", line 275, in
x, y = load_file(prefix + 'normal.csv',
File "/home/kali/Desktop/./classification.py", line 85, in load_file
dataset.drop(columns=[columns_to_drop_packet], inplace = True)
File "/usr/lib/python3/dist-packages/pandas/core/frame.py", line 4167, in drop
return super().drop(
File "/usr/lib/python3/dist-packages/pandas/core/generic.py", line 3889, in drop
obj = obj._drop_axis(labels, axis, level=level, errors=errors)
File "/usr/lib/python3/dist-packages/pandas/core/generic.py", line 3923, in _drop_axis
new_axis = axis.drop(labels, errors=errors)
File "/usr/lib/python3/dist-packages/pandas/core/indexes/base.py", line 5287, in drop
raise KeyError(f"{labels[mask]} not found in axis")
KeyError: "[('timestamp', 'src_ip', 'dst_ip')] not found in axis"

Thank you for your interest. Did you load the correct file? Could you please print the data frame column names?