title: Formatting Pandas groupby() for merge
body: <p>I was hoping someone could help me with something relatively simple I have been trying to do. Recently, I used <code>groupby</code> to sum over different groups in my <code>df</code>, as you can see below: </p>
  
  <pre><code>                      MSA.name ifr.industry
  0   Abilene, TX Metro Area           90
  1   Abilene, TX Metro Area            P
  2   Abilene, TX Metro Area           90
  3   Abilene, TX Metro Area            F
  4   Abilene, TX Metro Area           90
  5   Abilene, TX Metro Area           90
  6   Abilene, TX Metro Area           90
  7   Abilene, TX Metro Area           90
  </code></pre>
  
  <p>Then I sum employees over industries with <code>df.groupby(['MSA.name', 'ifr.industry'])['employees'].sum()</code></p>
  
  <pre><code>MSA.name               ifr.industry        employees  
  Abilene, TX Metro Area 10-12               720
                         13-15                70
                         16                   87
                         17-18                54
                         20-21                77
                         22                  403
                         23                  324
                         24                  383
                         25                  701
                         28                  310
                         29                  198
                         30                  233
  </code></pre>
  
  <p>However, I want to merge this back into the original <code>df</code>, but I can't see how to do this easily. I wanted to know if there was a way that <code>groupby()</code> would list the <code>MSA.name</code> for every observation after I do the <code>groupby()</code>.</p>