I want to remove the duplicates (keeping only the first occurrence) if similar values are found between two columns.
My expected result
appreciate it if someone can help
import pandas as pd df1 = pd.DataFrame({'Customer':['John Tom', 'Harry', 'Simon', 'Tom'], 'Supplier':['Harry', 'John Tom', 'Harry', 'Simon']})ie. I want to remove the second-row values as both values in that row were found previously in two columns in one row.
My expected result
Output: Customer Supplier
0 John Tom Harry
1 Simon Harry
2 Tom Simon
Is there a way to remove such occurrences by considering them as duplicates?appreciate it if someone can help