1# Keep first duplicate value
2my_df = my_df.drop_duplicates(subset=['my_var'])
3
4# Keep last duplicate value
5my_df = my_df.drop_duplicates(subset=['my_var'], keep='last')
6
7# Remove all duplicate values
8my_df = my_df.drop_duplicates(subset=['my_var'], keep=False)