title: Python: Sum rows in Pandas dataframe which match a column value?
body: <p>I have a Pandas dataframe with ~22.000 rows. It contains 200 different scenarios (<code>IDScen</code>). I want to sum all the rows in <code>mayjul</code> and <code>aug</code> column for each scenario. Preferably it can come as a row beneath each scenario, with the sum.</p>
  
  <pre><code>IDScen  IDCell  Ctot    Sjul        Saug        mayjul      aug
  1   37276   37.23220    0.001109    0.000057    0.000222    0.000011
  1   36430   6.26848     0.004882    0.000109    0.000976    0.000022
  1   37685   14.06670    0.000296    0.000007    0.000059    0.000001
  1   38322   28.67790    0.000287    0.000010    0.000057    0.000002
  1   36638   15.78980    0.002024    0.000056    0.000405    0.000011
  </code></pre>
  
  <p>So for example </p>
  
  <pre><code>    IDScen  IDCell  Ctot    Sjul        Saug        mayjul      aug
          1   37276   37.23220    0.001109    0.000057    0.000222    0.000011
          1   36430   6.26848     0.004882    0.000109    0.000976    0.000022
          1   37685   14.06670    0.000296    0.000007    0.000059    0.000001
          1   38322   28.67790    0.000287    0.000010    0.000057    0.000002
          1   36638   15.78980    0.002024    0.000056    0.000405    0.000011
  sum scenario 1                                             sum         sum
  </code></pre>
  
  <p>I have tried to use the <code>groupby</code> function, but I can't seem to get it right</p>