the code works fine!
However I am a newbie and tried to make editing the training data a bit more easy so I've created a file training_data.data as:
Green,3,Apple
Yellow,3,Apple
Red,1,Grape
Red,1,Grape
Yellow,3,Lemon
and then import this with:
import pandas as pd
training_data = pd.read_csv('training_data.data', header=-1)
and now I gut the error TypeError: 'int' object is not subscriptable.