@staticmethod
def remove_duplicates(df):
    """ Sort the dataframe and remove duplicates -- note, not extensively tested """
    p1 = df[['p1', 'p2']].values.min(1)
    p2 = df[['p1', 'p2']].values.max(1)
    df['p1'] = p1
    df['p2'] = p2
    df.sort_values(['p1', 'p2'], inplace=True)
    df.drop_duplicates(['p1', 'p2'], inplace=True)
    df = df[df['p1'] != df['p2']]
    df.reset_index(inplace=True, drop=True)
    return df
