title: How to reform this dataframe to be longer?
body: <p>Here I have a table (it is really large, I just give a simplified example)</p>
  <pre><code>import pandas as pd
  
  indices = (1,2,3,4)
  columns = [&quot;id&quot;, &quot;height1&quot;, &quot;height2&quot;, &quot;height3&quot;]
  data = ([&quot;xxx1&quot;, 1, 2, 3], [&quot;xxx2&quot;, 4, 5, 6], [&quot;xxx3&quot;, 7, 8, 9], [&quot;xxx4&quot;, 10, 11, 12])
  df = pd.DataFrame(data, index = indices, columns = columns)
  df
  </code></pre>
  <p>which returns
  <a href="https://i.stack.imgur.com/ly5Au.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ly5Au.png" alt="enter image description here" /></a></p>
  <p>However, what should I do if I want to this dataframe to be displayed in this way?
  I tried to use groupby(id) and then unstack() but failed.</p>
  <p>Any help or hint is welcome</p>
  <pre><code> id   height  score
  xxx1  height1    1
  xxx1  height2    2
  xxx1  height3    3
  xxx2  height1    4
  xxx2  height2    5
  .
  .
  .
  xxx4  height3   12
  </code></pre>