#Add the new column which gives a unique number to each of these labels df['label_num'] = df['label'].map({ 'Household' : 0, 'Books': 1, 'Electronics': 2, 'Clothing & Accessories': 3 }) #checking the results df.head(5)
#Add the new column which gives a unique number to each of these labels df['label_num'] = df['label'].map({ 'Household' : 0, 'Books': 1, 'Electronics': 2, 'Clothing & Accessories': 3 }) #checking the results df.head(5)