title: Pandas groupby feature question for output CSV
body: <p>I have the following code</p>
  <pre><code>df.groupby('AccountNumber')[['TotalStake','TotalPayout']].sum()
  </code></pre>
  <p>which displays as I would like it to in pandas</p>
  <p>The issue is when I output this to a CSV the first column AccountNumber disappears. How can I keep the AccountNumber column after using df.to_csv?</p>
  <pre><code>df = df.groupby('AccountNumber')[['TotalStake','TotalPayout']].sum()
  df.to_csv(&quot;AccountNumbers.csv&quot;,index=False)
  
  </code></pre>