You can use the drop_duplicates() function with the parameter subset. You can specify the column(s) for the parameter subset.
Here is an example:
>>> import pandas as pd>>> df = pd.DataFrame({'a':[1,2,3,4,5,1,3], 'b':[11,12,13,14,15,12,16]})>>> df a b0 1 111 2 122 3 133 4 144 5 155 1 126 3 16>>> df.drop_duplicates(subset=["a"]) a b0 1 111 2 122 3 133 4 144 5 15>>>
>>> import pandas as pd
>>> df = pd.DataFrame({'a':[1,2,3,4,5,1,3], 'b':[11,12,13,14,15,12,16]})
>>> df
a b
0 1 11
1 2 12
2 3 13
3 4 14
4 5 15
5 1 12
6 3 16
>>> df.drop_duplicates(subset=["a"])
>>>