I have a dataset like this:
Country Name Match Result
US Martin Win 3
US Martin Lose 1
US Martin Draw 5
UK Luther Win 5
UK Luther Draw 3
I'd like to add two more columns with sum result from Win, Lose and Draw, and percentage of each match like this:
Country Name Match Result All Percentage
US Martin Win 3 8 0.375
US Martin Lose 1 8 0.125
US Martin Draw 5 8 0.625
UK Luther Win 6 10 0.6
UK Luther Draw 4 10 0.4
I've already tried using groupby and got result for size total match. However I don't know how to put it in the next column.
Thank you
Allcolumn forMartinbe9, not8(5 + 3 + 1)?