Python - Subset DataFrame Berdasarkan Nilai Unik dari Clumn

# Keep first duplicate value
my_df = my_df.drop_duplicates(subset=['my_var'])

# Keep last duplicate value
my_df = my_df.drop_duplicates(subset=['my_var'], keep='last')

# Remove all duplicate values
my_df = my_df.drop_duplicates(subset=['my_var'], keep=False)
Andrea Perlato