I have a data frame like this:
Name subname Feature1 Feature2 ...
AAA a 0.123 0.345 ...
AAA b 0.123 0.345 ...
BBB a 0.123 0.345 ...
BBB b 0.123 0.345 ...
I want to create labels (adding a new column):
Name subname Feature1 Feature2 ...Class
AAA a 0.123 0.345 ... 1
AAA b 0.123 0.345 ... 1
BBB a 0.123 0.345 ... 2
BBB b 0.123 0.345 ... 2
So that I can fit the data into a classification model, is there a way that I can create those labels in an efficient way? I got more than 5000 rows, many thanks.