Jun-13-2021, 08:10 AM
Have a question how to move each team row to a new column dataset. So, I have 10 strings for 1 game and need to move this strings to columns to make dataframe look like this and for every stat.
Have thoughts, its needed to make function that convert it, but Im new with python, so.. need help.
I leave link to main dataframe.
df = pd.DataFrame({'Team1':'[teamname]' , 'Team2':'[teamname]' , 'Score1': [0], 'Score2': [2],'team1_Player1_KD': [1], 'team1_Player2_KD': [2],'team1_Player3_KD': [1], 'team1_Player4_KD': [2],'team1_Player5_KD': [2], 'team2_Player1_KD': [2],'team2_Player2_KD': [1], 'team2_Player3_KD': [2],'team2_Player4_KD': [2], 'team2_Player5_KD': [2]})And my final dataset should look like 1 string per match with 200+ columns with player stats. But now have 25 columns for player and 5 string with player stat of 1 team and 2nd team.
Have thoughts, its needed to make function that convert it, but Im new with python, so.. need help.
I leave link to main dataframe.