Aug-28-2019, 06:16 AM
Hi all, I would like to drop all unique entries based on a specific column value.
I give an example below
Any ideas ?
Thanks
Alex
I give an example below
data = [[10105, 1], [10105, 1], [10105, 0], [20205, 0], [20205, 0], [20205, 1], [20205, 1],[80215, 1]] test=pd.DataFrame(data,columns=["ID","label"]) test Out[65]: ID label 0 10105 1 1 10105 1 2 10105 0 3 20205 0 4 20205 0 5 20205 1 6 20205 1 7 80215 1I would like to keep all rows except the last one since the ID value happens only once. All the other rows are good.
Any ideas ?
Thanks
Alex