I am trying to remove those rows if the swap also exists in the data frame.
For example, if I have a data frame:
1 2
1 3
1 4
2 4
4 2
2 1
Then the row (1,2), (2,4) will be removed because (2,1) and (4,2) are also in the df. Is there any fast and neat way to do it? Thank you!