Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

keep only one duplicate in pandas

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #duplicate #pandas
ADD COMMENT
Topic
Name
7+3 =