title: Pandas Melt Function
body: <p>I have a dataframe:</p>
  
  <pre><code>df = pd.DataFrame([[2, 4, 7, 8, 1, 3, 2013], [9, 2, 4, 5, 5, 6, 2014]], columns=['Amy', 'Bob', 'Carl', 'Chris', 'Ben', 'Other', 'Year'])
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>   Amy  Bob  Carl  Chris  Ben  Other  Year
  0    2    4     7      8    1      3  2013
  1    9    2     4      5    5      6  2014
  </code></pre>
  
  <p>And a dictionary:</p>
  
  <pre><code>d = {'A': ['Amy'], 'B': ['Bob', 'Ben'], 'C': ['Carl', 'Chris']}
  </code></pre>
  
  <p>I would like to reshape my dataframe to look like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>    Group   Name  Year  Value
   0      A    Amy  2013      2
   1      A    Amy  2014      9
   2      B    Bob  2013      4
   3      B    Bob  2014      2
   4      B    Ben  2013      1
   5      B    Ben  2014      5
   6      C   Carl  2013      7
   7      C   Carl  2014      4
   8      C  Chris  2013      8
   9      C  Chris  2014      5
  10  Other         2013      3
  11  Other         2014      6
  </code></pre>
  
  <p>Note that <code>Other</code> doesn't have any values in the <code>Name</code> column and the order of the rows does not matter. I think I should be using the <code>melt</code> function but the examples that I've come across aren't too clear.</p>