Reputation: 1
I have two dataframes with duplicates within one column. I need to extract the duplicates into a separate dataframe.
df1=
col1 col2 col3 col4
BLUE .5 yes 5
GREEN .2 no 2
PINK .3 yes 3
df2=
col1 col2 col3 col4
RED .9 yes 9
GREEN .2 yes 2
BLUE .7 yes 7
For example, although the col2 in the GREEN row is not the same, I need to extract it from df2 only and pull it into a new df.
But also working with thousands of rows for hoping for a way to do this in bulk.
Upvotes: 0
Views: 26