I want to enumerate the Customer-Assessor group in ascending order. Restarting every Client. Could you help me how to do it? I've tried using the groupby function, however, I'm not getting it to be restarted for each client.
Here is an example of the dataframe:
Date | Customer | Advisor |
---|---|---|
01/01/2023 | A | AA |
02/01/2023 | A | BB |
03/01/2023 | A | CC |
04/01/2023 | A | AA |
01/01/2023 | B | AA |
02/01/2023 | B | BB |
03/01/2023 | B | AA |
04/01/2023 | B | CC |
Follow the expected result: The date is important, but the dataframe is already sorted by date.
Date | Customer | Advisor | Customer-Advisor |
---|---|---|---|
01/01/2023 | A | AA | 1 |
02/01/2023 | A | BB | 2 |
03/01/2023 | A | CC | 3 |
04/01/2023 | A | AA | 1 |
01/01/2023 | B | AA | 1 |
02/01/2023 | B | BB | 2 |
03/01/2023 | B | AA | 1 |
04/01/2023 | B | CC | 3 |
Thank you