I am trying to update an existing data frame (df1) with data that is received from a different data frame (df2). Data frame df2 may have new column, new rows or new data. Here is an example of what I am trying to accomplish.
df1
var1 var2 var3
a 8 4 12
b -1 -4 -3
c 9 12 11
d 12 15 7
e 1 3 12
f 2 4 6
df2 (note that this is almost like df1 except it does not have column var1, has a new column var4, has updated values for var3, var2 is the same and has a new row "month s3").
var2 var3 var4
a 4 10 12
b -4 0 4
c 12 15 9
d 15 12 5
e 3 17 7
f 4 16 8
g 0 0 4
This should be the updated df
var1 var2 var3 var4
a 8 4 10 12
b -1 -4 0 4
c 9 12 15 9
d 12 15 12 5
e 1 3 17 7
f 2 4 16 8
g 0 0 0 4
What's the best way to accomplish this task? (I am specifically stuck on adding any extra row that may be present in df2).