title: Pandas Percentage count on a DataFrame groupby
body: <p>I have a DataFrame (<code>mydf</code>) along the lines of the following:</p>
  
  <pre><code>Index   Feature ID  Stuff1  Stuff2
  1       True    1   23      12
  2       True    1   54      12
  3       False   0   45      67
  4       True    0   38      29
  5       False   1   32      24
  6       False   1   59      39
  7       True    0   37      32
  8       False   0   76      65
  9       False   1   32      12
  10      True    0   23      15
  ..n     True    1   21      99
  </code></pre>
  
  <p>I am trying to calculate the True and False percentages of the <code>Feature</code> for each <code>ID</code> (0 or 1), and I am looking for two output for each ID:</p>
  
  <pre><code>Feature ID  Percent
  True    1   20%
  False   1   30%
  
  Feature ID  Percent
  True    0   30%
  False   0   20%
  </code></pre>
  
  <p>I have tried a few attempts, but I start getting counts for all columns and then a percentage for all columns.</p>
  
  <p>Here's my bad attempt:</p>
  
  <pre><code>percentageID0 = mydf[ mydf['ID']==0 ].set_index(['Feature']).count()
  percentageID1 = mydf[ mydf['ID']==1 ].set_index(['Feature']).count()
  fullcount = (mydf.groupby(['ID']).count()).sum()
  
  print (percentageID0/fullcount) * 100
  print (percentageID1/fullcount) * 100
  </code></pre>
  
  <p>Think I am getting mixed up with the groupby/index format.</p>