title: Aggregation of values in DataFrame in Python Pandas?
body: <p>I have DataFrame with contracts like below:</p>
  <pre><code>df = pd.DataFrame ({&quot;ID&quot; : [&quot;1&quot;, &quot;2&quot;, &quot;1&quot;, &quot;2&quot;], 
                      &quot;currency&quot; : [&quot;USD&quot;, &quot;USD&quot;, &quot;EUR&quot;, &quot;CHF&quot;],
                       &quot;amount&quot; : [100, 200, 400, 500]})
  </code></pre>
  <p>And I need to calculate:</p>
  <ol>
  <li>(col1) Number of contracts with EUR currency</li>
  <li>(col2) Number of contracts with currency other than EUR</li>
  <li>(col3) Amount of contracts on EUR
  4/ (col4) Amount of contract with currency other than EUR</li>
  </ol>
  <p>To be more precision, I need as a result DataFrame like below:
  <a href="https://i.stack.imgur.com/jCA3q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jCA3q.png" alt="enter image description here" /></a></p>