title: matching pairs of positive and negative numbers for every id
body: <p>I have the dataframe below:</p>
  <pre><code>import pandas as pd
  d = {'id': [1,1,2,2,3,3,3,4,4],
      'amount':[2,3,5,-5,2,3,-5,3,4]}
  
  d = pd.DataFrame(d)
  d
     id   amount
  0   1   2
  1   1   3
  2   2   5
  3   2   -5
  4   2   4
  5   2   6
  6   3   2
  7   3   3
  8   3   -5
  9   4   3
  10  4   4
  11  4   100
  12  4   -100
  </code></pre>
  <p>So what i want to do, is match the positive with the negative values per id and i do this:</p>
  <pre><code>d[d.groupby(['id'])['amount'].transform('sum').eq(0)
  
  </code></pre>
  <p>which gives me this output:</p>
  <pre><code>
     id   amount
  2   2   5
  3   2   -5
  4   3   2
  5   3   3
  6   3   -5
  
  </code></pre>
  <p>So as you can see my code does not only matches pairs of rows as i want. For instance, for id 3, it matches three rows on the condition i've set. How can i get it to only match pairs of rows and  have the  desired output as the one below:</p>
  <pre><code>   id   amount
  2   2   5
  3   2  -5
  11  4   100
  12  4  -100
  
  </code></pre>