I have a pandas DF with two columns, one columns consists of unique filenames and the other consists of that filenames' label. I also have a numpy array of the filenames that i can use for training my model. I need to extract the labels from the DF that match the filenames i can use. I tried this:
x = []
for i in nparray:
for j in DF['filenames']:
if DF['filenames'][j] == nparray[i]:
x.append(DF['label'][j])
if I do this i get a key error with the name of the first filename of the DF