I want to delete duplicate rows with respect to column 'a' in a dataFrame with the argument 'take_last = True' unless some condition. For instance, If I had the following dataFrame
a | b | c
1 | S | Blue
2 | M | Black
2 | L | Blue
1 | L | Green
I want to drop duplicate rows with respect to column 'a' with the general rule as take_last = true unless some condition say, c = 'Blue', in which case I want to make the argument take_last = false.
so that I get this as my resulting df
a | b | c
1 | L | Green
2 | M | Black
take_last=Truemeanstake only Green?