Remove reverse duplicates from dataframe
<p>I have a data frame with two columns, <code>A</code> and <code>B</code>. The order of <code>A</code> and <code>B</code> is unimportant in this context; for example, I would consider <code>(0,50)</code> and <code>(50,0)</code> to be duplicates. In pandas, what is an efficient way to remove these duplicates from a dataframe?</p>

<pre><code>import pandas as pd

# Initial data frame.
data = pd.DataFrame({'A': [0, 10, 11, 21, 22, 35, 5, 50], 
                     'B': [50, 22, 35, 5, 10, 11, 21, 0]})
data
    A   B
0   0  50
1  10  22
2  11  35
3  21   5
4  22  10
5  35  11
6   5  21
7  50   0

# Desired output with "duplicates" removed. 
data2 = pd.DataFrame({'A': [0, 5, 10, 11], 
                      'B': [50, 21, 22, 35]})
data2
    A   B
0   0  50
1   5  21
2  10  22
3  11  35
</code></pre>

<p>Ideally, the output would be sorted by values of column <code>A</code>.</p>