I have 2 similar dataframes (df1
& df2
), having the columns id,date,count.
I want to concatenate these 2 df's, in a way such that if the {id,date}
overlaps, I want to give preference to the row from df2.
e.g.:
df1 has the record: id1, 2018/02/03, 45
df2 has the record: id1, 2018/02/03, 65
When I merge/concat, I only need the record from df2 i.e. {id1, 2018/02/03, 65
}.
Apart from this duplicate resolve logic, I need all the other rows from both the df's as is. How can I achieve this in python?