title: Sumifs in Pandas with two conditions
body: <p>I want the pandas equivalent of the Excel's <code>sumifs</code> for example</p>
  
  <pre><code>=SUMIFS($D4:D$107,$D$107,$G4:G$107)
  </code></pre>
  
  <p>I have three columns, the <code>contract</code>, the <code>amount</code> and <code>transaction_type_tla</code>. For each <code>contract</code>, I would like to sum the <code>amount</code> if the transaction type is <code>CBP</code>. The following formula is not working: </p>
  
  <pre><code>data['Var']=(data.groupby('contract',"transaction_type_tla=='CBP'")['amount'].cumsum())
  </code></pre>