How to create number based on group in a column
Hi, I have a categorical column that has repeated same string order randomly. I want to label number to each group that has same string like the example in picture. How I can do to create the column of result?