Imagine we have the following dataframe(which has 16 cols but I will just write the 2 we are interested in)
df
A B
1111-AB 1
1234-VNB 1
1111-AB 2
2222-VXQ 1
as you can see the 1111-AB is duplicated and I want to keep the rows that have the bigger value in B. Thus our example will be
df
A B
1234-VNB 1
1111-AB 2
2222-VXQ 1
as you can see the order of the other columns is the same(don t want to change it)