title: Perform groupby calculation on column excluding certain conditions
body: <pre><code>I have this df:
  
  data = {'A':[102, 102, 102, 102, 312, 312, 312], 
          'B':[1001,1001,1001,1001,1001,1001,1001],
          'C':[3005,3005,3005,3005,3005,3005,3005],
          'D':[2004,2004,2004,2004,2002,2002,2002],
          'E':[1,3,5,999,1,5,999],
          'F':[300,1,192,837,19,1,1037]} 
  
  df = pd.DataFrame (data, columns = ['A','B','C','D','E','F'])
  
  df.head(7)
  </code></pre>
  
  <p>A line of code calculates the percentage which works apart from I want it to exclude the count values where the rows value in column E is (999):</p>
  
  <pre><code>df['Percentage'] = 100 * df['F'] / df.groupby('A')['F'].transform('sum')
  </code></pre>
  
  <p>Percentage should show:</p>
  
  <pre><code>Percentage
  60.85193
  0.20284
  38.94523
  (Blank)
  95
  5
  (Blank)
  </code></pre>
  
  <p>Any help would be greatly appreciated</p>