import pandas as pd
dfa = {'account':['a','b','a','c','a'],
'ret_type':['CTR','WO','T','CTR','T'],
'val':['0.0','0.1','0.2','0.3','0.4'],
'ins_date':['11','12','11','13','14']}
df = pd.DataFrame(dfa)
account ret_type val ins_date
0 a CTR 0.0 11
1 b WO 0.1 12
2 a T 0.2 11
3 c CTR 0.3 13
4 a T 0.4 14
У меня есть требование удалить дублирующуюся строку, чтобы
1 duplicate row means combination of (account,ins_dat)
2 if duplicate found i need to keep row with ret type CTR abd drop row with T
3 i dont want to delete T rows for which no duplicate row is there like 4
4 in this example fr ex 2nd row is deleted as output finally
как мне это сделать?