Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

concatenate dataframes pandas without duplicates

>>> df1
   A  B
0  1  2
1  3  1
>>> df2
   A  B
0  5  6
1  3  1
>>> pandas.concat([df1,df2]).drop_duplicates().reset_index(drop=True)
   A  B
0  1  2
1  3  1
2  5  6
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #concatenate #dataframes #pandas #duplicates
ADD COMMENT
Topic
Name
1+1 =