To illustrate my question, consider the following Pandas DataFrame:
df = pd.DataFrame({'player': ['Bob', 'Jane', 'Alice'],
'hand': [['two','ace'], ['queen','king'], ['three','five']]})
I would like to sort each hand array. I've tried using lamdas orlooping through df using iterrow, but I couldn't get either to work.
BONUS: The reason I want it sorted is so I could do a groupby on that column to identify all players having same hand. Perhaps, there is a more direct way of doing it.