Bad Coder
Bad Coder

Reputation: 195

How to remove duplicate rows by substituting the zero value with another number in pandas python?

So, I have this column enter image description here

And, I wanted to convert into this column enter image description here

I want to replace zero with number. So, how can I do that using pandas python?

Upvotes: 1

Views: 57

Answers (1)

BENY
BENY

Reputation: 323326

Try with groupby

out = df.groupby(['col1','col2','col3'],as_index=False).max()

Upvotes: 3

Related Questions