pandas keep first code example Example 1: remove duplicate row in df df = df.drop_duplicates() Example 2: df remove duplicate rows df = df.drop_duplicates() p