drop_duplicates(keep='last') code example Example: df remove duplicate rows df = df.drop_duplicates() p