title: Pandas groupby count to have headers in same line
body: <p>My dataframe is as follows:</p>
  <pre><code>df = pd.DataFrame({
  'A':list('ababab'),
  'B':list('aaabbb'),
  'C':list('xyzklm'),
  })
  </code></pre>
  <p>I am trying to groupby <code>A</code> and <code>B</code> and count. So, what I have tried is:</p>
  <pre><code>Option 1: 
      df.groupby([&quot;A&quot;,&quot;B&quot;]).agg('count')
  
  Option 2: 
      df.groupby([&quot;A&quot;,&quot;B&quot;])[&quot;B&quot;].agg('count')
  
  Option 3:
      df.groupby([&quot;A&quot;,&quot;B&quot;], as_index=False).agg('count')
  </code></pre>
  <p>here are the outputs:</p>
  <p><a href="https://i.stack.imgur.com/AE3ET.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AE3ET.png" alt="enter image description here" /></a></p>
  <p>But, I want to have all header (A, B, C) in the same line as below:</p>
  <p><a href="https://i.stack.imgur.com/cnBCy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cnBCy.png" alt="enter image description here" /></a></p>