I have a DataFrame d
of games played of the game Go. The important columns for these are the player name, and if they won or not that particular game. How can I make a new DataFrame with a column that is Player name (without repeating names), the total games they played and the total number they won. Example:
import pandas as pd
d = {'Nombres': ['pepe','tito','pepe','pepe'], 'col2': ['Win','Lost','Win','Lost']}
df2 = pd.DataFrame(data=d)
This is what I currently do, counting the number of games played per user:
df3 = df2.groupby(['Jugador']).size().reset_index(name='count')
How can I add the column of how many games each player won?