Category DishName Id
0 a Pistachio 621f4884e48bc60012364b13
1 a Pistachio 621f4884e48bc60012364b13
2 a Pistachio 621f4884e48bc60012364b13
3 a achar 621f4884e48bc60012364b13
4 b achar 621f4884e48bc60012364b13
5 b achar 621f4884e48bc60012364b13
6 a chicken 621f4884e48bc60012364b13
7 b chicken 621f4884e48bc60012364b13
8 c chicken 621f4884e48bc60012364b13
My dataframe has 3 columns category, dishname and id. Considering the id and the dishname I have to assign category.
Assign "a" if all the category values are "a"
Assign "b" if category values are "a","b"
Assign "c" if category values are "a","b","c"
Expected output is
Category DishName Id
0 a Pistachio 621f4884e48bc60012364b13
1 a Pistachio 621f4884e48bc60012364b13
2 a Pistachio 621f4884e48bc60012364b13
3 b achar 621f4884e48bc60012364b13
4 b achar 621f4884e48bc60012364b13
5 b achar 621f4884e48bc60012364b13
6 c chicken 621f4884e48bc60012364b13
7 c chicken 621f4884e48bc60012364b13
8 c chicken 621f4884e48bc60012364b13