I am trying to clean my pandas data frame from duplicate rows. I know how to remove rows where column values are the same but I'm not sure how to do that if (column A on row 1 is equal to column B on row 2 and column B on row 1 is equal to column A on row 2). I hope it is not too confusing. I've added an example of a table below. I would consider rows 2 and 3 to be duplicates. How would I remove them using pandas?
Edit:
Duplicate rows are not necessarily right above or below each other. I need to keep only one of those rows (doesn't matter which one specifically).