I need to remove duplicates from all of the columns.
My data:
id country publisher weak A B C
123 US X 1 6.77 0 0
123 US X 1 0 1.23 88.7
456 BZ Y 2 0 56.87 9.65
456 BZ Y 2 2.76 0 0
456 BZ Y 2 0 0 0
I used drop_duplicates-
df1=df.drop_duplicates()
But I need a condition that will take all the values>0 for each id.
Also, I have more columns than just 'A','B','C' so I'm looking for solution that will take all the columns into account.
Here an example for what I'm looking for:
id country publisher weak A B C
123 US X 1 6.77 1.23 88.7
456 BZ Y 2 2.76 56.87 9.65