So I am trying to make a machine learning model for recognizing hand signs. I am pretty new to machine learning and numpy. I am facing the following error
pixel0 pixel1 pixel2 pixel3 ... pixel9212 pixel9213 pixel9214
pixel9215
0 255 255 255 255 ... 255 255 255 255
0 255 255 255 255 ... 255 255 255 255
0 255 255 255 255 ... 255 255 255 255
0 255 255 255 255 ... 255 255 255 255
0 255 255 255 255 ... 255 255 255 255
[5 rows x 9216 columns]
Traceback (most recent call last):
File "classification.py", line 12, in <module>
y = np.array(train.pop('label'))
File "/home/bing/.local/lib/python2.7/site-packages/pandas/core/generic.py", line 809, in pop
result = self[item]
File "/home/bing/.local/lib/python2.7/site-packages/pandas/core/frame.py", line 2927, in __getitem__
indexer = self.columns.get_loc(key)
File "/home/bing/.local/lib/python2.7/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: 'label'
This is my classification.py
import pandas as pd
import numpy as np
train = pd.read_csv("train60.csv")
print(train.head())
y = np.array(train.pop('label')) # this is the error
I have posted the full trackback message Help would be appreciated.