remove duplicate rows with same two columns pandas code example Example: remove duplicates based on two columns in dataframe df.drop_duplicates(['A','B'],keep= 'last')