I have a data frame like this:
df:
ID Award Award_ID
1 Ninja N13
1 Ninja N19
1 Warrior W16
2 Alpha A99
2 Delta D18
3 Alpha A101
3 Alpha A102
3 Alpha A103
4 Delta D12
Some of the IDs are repeated here. Whenever the ID has multiple occurrences, I want to make it into a single row by collating all the Award & Award_ID information in this format:
ID Multiple_Awards(Award_Names) Award(Award_IDs)
So, the expected output is:
df:
ID Award Award_ID
1 Multiple_Award(Ninja, Warrior) Ninja(N13, N19), Warrior(W16)
2 Multiple_Award(Alpha, Delta) Alpha(A99), Delta(D18)
3 Multiple_Award(Alpha) Alpha(A101,A102,A103)
4 Delta D12
In the case of a single award, I want the row to remain the same.
Can anyone help how to get the data into this format?
