I have a dataframe df like this:
x
1 paris
2 paris
3 lyon
4 lyon
5 toulouse
I would like to only keep not duplicated rows, for exemple above I would like to only keep the row 'toulouse'.
I tried drop duplicates pandas function but doesn't work:
df.drop_duplicates(subset=['x'], inplace=True)
Expected output:
x
5 toulouse
How can I do this ?