I am trying to add a new column to a dataframe. First I want to check if the id of each row exists in another dataframe. If it does then I want to populate my row entry with the value from the other dataframe. As an example my dataframe that I want to look up looks something like this:
id replays
0 2 1
1 5 1
2 6 2
3 8 3
4 12 1
The dataframe for which I want to create a new column initially looks like this, with just id's:
id
0 2
1 5
2 6
Ultimately this dataframe should be populated with a new column like this, where the replay entries are those that match the id from the first dataframe:
id replays
0 2 1
1 5 1
2 6 2
I am not sure how to achieve this. I have tried using lambda apply, but cannot manage to get the desired result.