I want to drop all rows in the ratings
df where the team has no game. So not in the fixtures
df in HomeTeam
or AwayTeam
occur. following I tried:
fixtures = pd.DataFrame({'HomeTeam': ["Team1", "Team3", "Team5", "Team6"], 'AwayTeam': [
"Team2", "Team4", "Team6", "Team8"]})
ratings = pd.DataFrame({'team': ["Team1", "Team2", "Team3", "Team4", "Team5",
"Team6", "Team7", "Team8", "Team9", "Team10", "Team11", "Team12"], "rating": ["1,5", "0,2", "0,5", "2", "3", "4,8", "0,9", "-0,4", "-0,6", "1,5", "0,2", "0,5"]})
ratings = ratings[(ratings.team != fixtures.HomeTeam) &
(ratings.team != fixtures.AwayTeam)]
but I get the error message:
ValueError: Can only compare identically-labeled Series objects
what can i do to stop the error from occurring?