Hello guys, I am trying to match columns in same data frame from `col 1, col 2` such that their label is different.
import pandas as pd
df1 = pd.DataFrame(
{
'Column1': [1,2,3,4],
'Column2':[10,11,12,13],
'Label':['apple', 'orange', 'apple', 'orange']
}
)
target = pd.DataFrame(
{
'Column1': [1,2,3,4],
'Column2':[11,10,13,12],
'Label':['apple', 'orange', 'apple', 'orange']
}
)
I am just looking for one match between columns `col 1` and `col 2` such that their labels are different, which is enough. So we cab only have either `(1, 13)` or `(1, 11)` but not bath in the target data frame. I …