Answers for "pandas remove duplicate rows based on column value"

8

remove duplicate row in df

df = df.drop_duplicates()
Posted by: Guest on August-19-2020
0

drop row with duplicate value

import pandas as pd
df = pd.DataFrame({"A":["foo", "foo", "foo", "bar"], "B":[0,1,1,1], "C":["A","A","B","A"]})
df.drop_duplicates(subset=['A', 'C'], keep=False)
Posted by: Guest on January-04-2020

Code answers related to "pandas remove duplicate rows based on column value"

Python Answers by Framework

Browse Popular Code Answers by Language