After some work, I came with a solution. I don't know if it is the best way to do it:
This is Dataframe 1:
In [4]: df1
Out[4]:
id ColA ColB ColC
0 4 AAA 5 Test 1
1 7 BBB 4 Test 2
2 49 CCC 7 Test 3
3 71 DDD 9 Test 4
4 84 EEE 11 Test 5
And this is Dataframe 2:
In [5]: df2
Out[5]:
Out[5]:
id ColA ColB ColC
0 4 AAAAA 5 Test 1
1 7 BBB 38 Test 2
2 49 CCC 7 Test 3
3 71 DDDDD 104 Test 4
4 84 EEE 11 Test_5
5 102 FFF 23 Test 6
So, I want to create a new Dataframe that only has items that exists only in Dataframe 2:
In [6]: df_unique = df2[~df2.id.isin(df1.id)]
In [7]: df_unique
Out[7]:
id ColA ColB ColC
5 102 FFF 23 Test 6
And then I remove these items from Dataframe 2 so that it has only the items that were modified:
In [8]: df2 = df2[~df2.id.isin(df_unique.id)]
In [9]: df2
Out[9]:
id ColA ColB ColC
0 4 AAAAA 5 Test 1
1 7 BBB 38 Test 2
2 49 CCC 7 Test 3
3 71 DDDDD 104 Test 4
4 84 EEE 11 Test_5
Finally, I create a new Dataframe that only has the items modified compared to Dataframe 1:
In [10]: df_merged = pd.merge(df2, df1, how='outer',
indicator=True).query('_merge=="left_only"').drop('_merge', axis=1)
In [11]: df_merged
Out[11]:
id ColA ColB ColC
0 4 AAAAA 5 Test 1
1 7 BBB 38 Test 2
3 71 DDDDD 104 Test 4
4 84 EEE 11 Test_5