I'd like to add two columns to an existing dataframe from another dataframe based on a lookup in the name column.
Dataframe to update looks like this:
| Player | School | Conf | Cmp | Att |
|---|---|---|---|---|
| Danny Wuerffel | Florida | 1 | 708 | 1170 |
| Steve Sarkisian | Brigham Young | 0 | 528 | 789 |
| Billy Blanton | San Diego State | 0 | 588 | 920 |
And I'd like to take the height and weight from this dataframe (actually a json file) and add it based on matching Player names:
| Name | School | Conf | Height | Weight | Pct | Yds |
|---|---|---|---|---|---|---|
| Danny Wuerffel | Florida | 1 | 6-2 | 217 | 60.5 | 10875 |
| Steve Sarkisian | Brigham Young | 0 | 6-3 | 230 | 66.9 | 7464 |
| Billy Blanton | San Diego State | 0 | 6-0 | 222 | 63.9 | 8165 |
Codewise I tried something like this so far:
existing_dataframe['Height'] = pd.Series(height_weight_df['Height'])
But I'm missing the part matching them on the name because the DFs aren't in the same order