This is my dataframe consisting of columns a,b,c,d.
Here
1 2 3 4
has mirror duplicate pair row of
3 4 1 2
Removing the duplicate pair should give me
CodePudding user response:
df.loc[pd.DataFrame(np.sort(df[['a','b','c','d']],1),index=df.index).drop_duplicates(keep='first').index]
U can use np.sort to sort columns in ascending order and then use .drop duplicates to get rid of the duplicate rows.