I have two data frames, df1
and df2
.
df1
contains a member_ID
and a result_id
df2
contains a member_ID
and a result_id
However, in df1
I have 1000 rows, in df2
I have 1200 rows. The df1
contains every row in df2
plus 200 other rows.
I need df3
, containing member_ID
and result_ID
,
which contains all 1200 rows, and if there is a result_id in df1
, then the value of df1
should be used, while if there is no result_id in df1
(for the remaining 200 rows), the result_ID in df2
should be used.
When merged, the df will consist of the 1000 matching rows only.