I have 2 dataframes like the following (A and B):
ID color
0 5 red
1 6 blue
2 7 blue
3 8 NaN
4 9 green
5 10 NaN
ID characteristic
0 7 tall
1 9 short
2 24 short
3 1 tall
4 11 medium
5 10 tall
for each ID in df A I want to check if there is a corresponding ID in dataframe B . If there is a corresponding ID, then new column in df A should have the value True
, and if not then False
The output should look like this:
ID color df_b_presence
0 5 red False
1 6 blue False
2 7 blue True
3 8 NaN False
4 9 green True
5 10 NaN True