I have two dataframes with the following data:
fixtures = pd.DataFrame(
{'HomeTeam': ["A", "B", "C", "D"], 'AwayTeam': ["E", "F", "G", "H"]})
ratings = pd.DataFrame({'team': ["A", "B", "C", "D", "E", "F", "G", "H"], "rating": [
"1,5", "0,2", "0,5", "2", "3", "4,8", "0,9", "-0,4"]})
now i want to map the value from ratings["rating"] to the respective team names but i can't get it to work. is it possible to have new columns with the ratings appear to the right of the HomeTeam and AwayTeam columns?
expected output:
fixtures:
homeTeam homeTeamRating awayTeam AwayTeamRating
Team A 1,5 Team E 3