(It is not as easy as just removing the duplicates with drop_duplicates. This question is not duplicated)
I have following dataframe
number doc type sum
0 15 document credit 10000
1 15 doc credit 9999
2 16 passport debit 20000
3 16 pas debit 19999
4 16 passport debit 25000
Row is considered duplicated if number and type are equal, doc and sum are not. So I need to remove them somehow specifying this condition
The result of removing duplicates should be
number doc type sum
0 15 document credit 10000
2 16 passport debit 20000
4 16 passport debit 25000
How can I achieve that?