I have a data frame for NBA data that I am having a hard time manipulating. I would like to change df1 to df2 by having both teams and their scores in a game along the same row twice to resemble the games outcome from both teams' standpoints:
df1
GameID TeamID TeamAbb PTS
0 1001 TOR 99
0 1023 ATL 86
1 1004 DAL 102
1 1003 POR 100
2 1015 LAL 96
2 1029 MIL 85
df2
GameID Team1ID Team2ID Team1Abb Team2Abb Team1PTS Team2PTS
0 1001 1023 TOR ATL 99 86
0 1023 1001 ATL TOR 86 99
1 1004 1003 DAL POR 102 100
1 1003 1004 POR DAL 100 102
So in essence, a sort of widening of the data frame.