How to identify and label similar rows in a pandas data frame
<p>I am working with a large data set that is composed of two panda data-frames.  One of which is the measurements taken from an instrument, the other is the variables present at each measurement.  The goal is to use a few supervised learning methods to predict the variables given the measurements.  I have not found a way to use multiple variables as the 'label' or y value in any supervised learning methods I have had experience with, such as scikit learn's random forest classifier.  </p>

<p>As a work around, I am trying to predict only one or two variables at a time by essentially making a new column that indicates similar rows.   This way I can feed in only one variable that actually represents two into the learning method </p>

<p>What I begin with:</p>

<pre><code>   a    b
0  1  103
1  6  103
2  1   103
3  2   2
4  3   103
5  6   103
6  1   103
7  5   103
8  1    2
9  2    2
</code></pre>

<p>What I want:</p>

<pre><code>   c    
0  1
1  2
2  1
3  3
4  4
5  2
6  1
7  5   
8  6
9  3
</code></pre>

<p>If you know how to do supervised learning with multiple label or y variables, that would also be quite helpful.  </p>