How can I change the name of columns from a dataframe
match_id player venue goals
1        John   home  4
1        Jim    home  0
1        Will   away  0 
1        Dan    away  1
...
based on a specific cell value (from column 'venue'), and end up with:
match_id home_player_1  home_player_1_goals home_player_2 home_player_2_goals away_player_1 away_player_1_goals away_player_2 away_player_2_goals
1        John           4                   Jim            0                    Will        0      Dan     1 
                                                               
 
     
    