title: Flatten multi-index pandas dataframe where column names become values
body: <p>Let us say I have the following dataframe:</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame(data={'Status' : ['green','green','red','blue','red','yellow','black'],
   'Group' : ['A','A','B','C','A','B','C'],
   'City' : ['Toronto','Montreal','Vancouver','Toronto','Edmonton','Winnipeg','Windsor'],
   'Sales' : [13,6,16,8,4,3,1]})
  df.drop('Status',axis=1,inplace=True)
  ndf = pd.pivot_table(df,values=['Sales'],index=['City'],columns=['Group'],fill_value=0,margins=False)
  </code></pre>
  
  <p>The result looks like this:</p>
  
  <pre><code>In [321]: ndf
  Out[321]:
            Sales
  Group         A   B  C
  City
  Edmonton      4   0  0
  Montreal      6   0  0
  Toronto      13   0  8
  Vancouver     0  16  0
  Windsor       0   0  1
  Winnipeg      0   3  0
  </code></pre>
  
  <p>How can I flatten it such that it becomes a single level data frame but with a column specifying the group?</p>
  
  <p>I.e., the result should be:</p>
  
  <pre><code>City    group   sales
  Edmonton    A   4
  Edmonton    B   0
  Edmonton    C   0
  Montreal    A   6
  Montreal    B   0
  Montreal    C   0
  Toronto     A   13
  Toronto     B   0
  Toronto     C   8
  Vancouver   A   0
  Vancouver   B   16
  Vancouver   C   0
  Windsor     A   0
  Windsor     B   0
  Windsor     C   1
  Winnipeg    A   0
  Winnipeg    B   3
  Winnipeg    C   0
  </code></pre>