title: How to compress or stack a pandas dataframe along the rows?
body: <p>I have a large pandas dataframe with several columns, however lets focus on two:</p>
  
  <pre><code>df = pd.DataFrame([['hey how are you', 'fine thanks',1], 
                      ['good to know', 'yes, and you',2],
                      ['I am fine','ok',3],
                      ['see you','bye!',4]],columns=list('ABC'))
  df
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>    A                   B           C
  0   hey how are you     fine thanks 1
  1   good to know    yes, and you    2
  2   I am fine             ok        3
  3   see you             bye!        4
  </code></pre>
  
  <p>From the previous data frame how can I compress two specific columns into a single pandas dataframe carrying out the values of the other columns? For example:</p>
  
  <pre><code>    A                C
  0   hey how are you  1
  1   fine thanks      1
  2   good to know     2
  3   yes, and you     2
  4   I am fine        3
  5   ok               3
  6   see you          4
  7   bye!             4
  </code></pre>
  
  <p>I tried to:</p>
  
  <pre><code>df = df['A'].stack()
  df = df.groupby(level=0)
  df
  </code></pre>
  
  <p>However, it doesnt work. Any idea of how to achieve the new format?</p>