title: Combining rows in pandas
body: <p>I have a DataFrame with an index called <code>city_id</code> of cities in the format <code>[city],[state]</code> (e.g., <code>new york,ny</code> containing integer counts in the columns. The problem is that I have multiple rows for the same city, and I want to collapse the rows sharing a <code>city_id</code> by adding their column values. I looked at <code>groupby()</code> but it wasn't immediately obvious how to apply it to this problem.</p>
  
  <p>Edit:</p>
  
  <p>An example: I'd like to change this:</p>
  
  <pre><code>city_id    val1 val2 val3
  houston,tx    1    2    0
  houston,tx    0    0    1
  houston,tx    2    1    1
  </code></pre>
  
  <p>into this:</p>
  
  <pre><code>city_id    val1 val2 val3
  houston,tx    3    3    2
  </code></pre>
  
  <p>if there are ~10-20k rows.</p>