Efficient way to get the unique values from 2 or more columns in a Dataframe : <p>Given a matrix from an <code>SFrame</code>:</p>

<pre><code>&gt;&gt;&gt; from sframe import SFrame
&gt;&gt;&gt; sf =SFrame({'x':[1,1,2,5,7], 'y':[2,4,6,8,2], 'z':[2,5,8,6,2]})
&gt;&gt;&gt; sf
Columns:
    x   int
    y   int
    z   int

Rows: 5

Data:
+---+---+---+
| x | y | z |
+---+---+---+
| 1 | 2 | 2 |
| 1 | 4 | 5 |
| 2 | 6 | 8 |
| 5 | 8 | 6 |
| 7 | 2 | 2 |
+---+---+---+
[5 rows x 3 columns]
</code></pre>

<p>I want to get the unique values for the <code>x</code> and <code>y</code> columns and I can do it as such:</p>

<pre><code>&gt;&gt;&gt; sf['x'].unique().append(sf['y'].unique()).unique()
dtype: int
Rows: 7
[2, 8, 5, 4, 1, 7, 6]
</code></pre>

<p>This way I get the unique values of x and unique values of y then append them and get the unique values of the appended list.</p>

<p>I could also do it as such:</p>

<pre><code>&gt;&gt;&gt; sf['x'].append(sf['y']).unique()
dtype: int
Rows: 7
[2, 8, 5, 4, 1, 7, 6]
</code></pre>

<p>But that way, if my x and y columns are huge with lots of duplicates, I would be appending it into a very huge container before getting the unique.</p>

<p><strong>Is there a more efficient way to get the unique values of a combined columns created from 2 or more columns in an SFrame?</strong></p>

<p><strong>What is the equivalence in pandas of the efficent way to get unique values from 2 or more columns in <code>pandas</code>?</strong></p>
