title: How to loop over grouped Pandas dataframe?
body: <p>DataFrame:</p>
  
  <pre><code>  c_os_family_ss c_os_major_is l_customer_id_i
  0      Windows 7                         90418
  1      Windows 7                         90418
  2      Windows 7                         90418
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>print df
  for name, group in df.groupby('l_customer_id_i').agg(lambda x: ','.join(x)):
      print name
      print group
  </code></pre>
  
  <p>I'm trying to just loop over the aggregated data, but I get the error:</p>
  
  <blockquote>
    <p>ValueError: too many values to unpack</p>
  </blockquote>
  
  <p>@EdChum, here's the expected output:</p>
  
  <pre><code>                                                    c_os_family_ss  \
  l_customer_id_i
  131572           Windows 7,Windows 7,Windows 7,Windows 7,Window...
  135467           Windows 7,Windows 7,Windows 7,Windows 7,Window...
  
                                                       c_os_major_is
  l_customer_id_i
  131572           ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...
  135467           ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...
  </code></pre>
  
  <p>The output is not the problem, I wish to loop over every group.</p>