title: Pandas dataframe reduce / add rows based on key
body: <p>I'm struggling a bit with kind of simple problem. Hope there is also a simple solution for it. My Dataframe looks like this.</p>
  
  <pre><code>DataFrame:
  8 buy  4
  7 sell 1
  6 buy  1
  5 sell 3
  4 sell 10  
  3 buy  100
  2 buy  110
  1 buy  120
  </code></pre>
  
  <p>Is there a way to add same orders that come after each other? So transform the df to:</p>
  
  <pre><code>DataFrame:
  8 buy  4
  7 sell 1
  6 buy  1
  4 sell 3 + 10 
  1 buy  100 + 110 + 120
  </code></pre>
  
  <p>My problem is a bit more complicated. I think it can be solved with iterrows but was hoping that there is a more simple solution.</p>