title: Compute row percentages in pandas DataFrame?
body: <p>I have my data in a pandas DataFrame, and it looks like the following:</p>
  
  <pre><code>cat  val1   val2   val3   val4
  A    7      10     0      19
  B    10     2      1      14
  C    5      15     6      16
  </code></pre>
  
  <p>I'd like to compute the percentage of the category (<code>cat</code>) that each value has. </p>
  
  <p>For example, for category <code>A</code>, <code>val1</code> is 7 and the row total is 36. The resulting value would be 7/36, so <code>val1</code> is 19.4% of category <code>A</code>.</p>
  
  <p>My expected result would look like the folowing:</p>
  
  <pre><code>cat  val1   val2   val3   val4
  A    .194   .278   .0     .528
  B    .370   .074   .037   .519
  C    .119   .357   .143   .381
  </code></pre>
  
  <p>Is there an easy way to compute this?</p>