I'm trying to work on an analysis of World of Warcraft gear and I'm having an issue with grouping. I can group all unique helms (head-gear) and count them by name. However, in-game your character can wear 2 rings. From the API this comes up as Ring 1 and Ring 2, the order does not matter but I would like to group the combination and count occurences.
Problem
The 2 same rings on different fingers/slots will appear as 2 separate counts.
data = [['Death God\'s Signet', 'Stitchflesh\'s Misplaced Signet', 12],
['Stitchflesh\'s Misplaced Signet','Death God\'s Signet', 13],
['Sinful Gladiator\'s Ring','Death God\'s Signet', 13]]
df = pd.DataFrame(data, columns = ['Ring 1', 'Ring 2', 'count'])
Goal
I want it to be grouped regardless of combination order. Like so,
Attempts
I've tried:
- Combining them as a list but it still has the same problem.
- Zipping them and sorting by values (like here)
- Sorting alphabetically and then grouping/making a list/ zipping