I have been searching for this answer for a day now. I can't find a solution. I have two data frames for NBA stats. One has just team names and the other has team names and stats associated. I want to look up each team name on the first dataframe and append the stats data from the second one to the rows that match that team name.
df1 = 'DATE' : [rows of dates], 'TEAM_NAME': [row of team names with duplicates]
df2 = 'TEAM_NAME': [row of unique team names], 'STAT #1' ['row of stats], etc....
I want df1
to look something like this:
'DATE' 'TEAM_NAME' 'STAT 1' 'STAT 2' etc...
1-Jan-21 Boston 23 15
5-Jan-21 Detroit 45 90
1-Jan-21 Boston 23 15
UPDATE* I used merge and join and it does do exactly what i need, there is one problem. Both functions group my data by team names as it encounters them to join. I need it to retain the original order and replace the rows that way.