SyntaxFix
Write A Post
Hire A Developer
Questions
You can do this simply by using pandas drop duplicates function
df.drop_duplicates(['A','B'],keep= 'last')