title: Transpose the columns in aggregate function in Pandas
body: <p>I am having an aggregate function with group by to get the summarized values. 
  My data set: </p>
  
  <pre><code>df=pd.DataFrame({"A":['a','a','a','a','a','a','b','b','b','b'],
           "Sales":[2,3,7,1,4,3,5,6,9,10],
           "Units":[12,2,2,33,6,2,4,8,3,5],
           "Week":[1,2,2,1,2,1,1,2,2,1]})
  </code></pre>
  
  <p>Upon this, I am applying the function:</p>
  
  <pre><code>def my_agg(x):
      names = {
          'Sales': x['Sales'].sum(),
          'Units': x['Sales'].sum()
               } 
  
      return pd.Series(names, index=['Sales','Units'])
  dfA= df.groupby(['A','Week']).apply(my_agg)
  </code></pre>
  
  <p>which gives me output: </p>
  
  <pre><code>    Sales  Units
  A Week              
  a 1         6      6
    2        14     14
  b 1        15     15
    2        15     15
  </code></pre>
  
  <p>I want to transpose week into columns. Like this:
  REQUIRED OUTPUT: </p>
  
  <pre><code>   Week 1              2      
  A      Sales  Units   Sales  Units        
  a         6     6      14     14   
  b        15    15      15     15
  </code></pre>
  
  <p>ALSO, please suggest for OUTPUT 2:</p>
  
  <pre><code>           Sales         Units
  A  Week   1            2
  a         6    14      6      14   
  b        15    15     15      15
  </code></pre>