title: How to count all positive and negative values in a pandas groupby?
body: <p>Let's assume we have a table:</p>
  
  <pre><code>df = pd.DataFrame({'A' : ['foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'foo'],
                     'B' : ['one', 'one', 'two', 'three', 'two', 'two', 'one', 'three'],
                     'C' : np.random.randn(8), 'D' : np.random.randn(8)})
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>      A       B          C           D
  0    foo     one    -1.304026    0.237045
  1    bar     one     0.030488   -0.672931
  2    foo     two     0.530976   -0.669559
  3    bar     three  -0.004624   -1.604039
  4    foo     two    -0.247809   -1.571291
  5    bar     two    -0.570580    1.454514
  6    foo     one     1.441081    0.096880
  7    foo     three   0.296377    1.575791
  </code></pre>
  
  <p>I want to count how many positive and negative numbers in column C belong to each group in column A and in what proportion. There are much more groups in A than foo and bar, so group names shouldn't be in the code.</p>
  
  <p>I was trying to groupby A and then filter, but didn't find the right way. Also tried to aggregate with some smart lambda, but didn't succeed.</p>