I have a dataframe, I would like to find the common rows based on a specific columns.
packing_id col1 col2 col3 col4
1 1.0 2.0
2 2.0 2.0
3 1.0 1.0
4 3.0 3.0
. . .
. . .
I would like to find the rows where the col1
and col2
values are the same.
I tried
np.where(df.col1==df.col2)
but it is not the right approach. I would appreciate your advice. Thanks.