title: pandas fill column with random numbers with a total for each row
body: <p>I've got a pandas dataframe like this:</p>
  
  <pre><code>     id  foo  
   0   A   col1 
   1   A   col2  
   2   B   col1  
   3   B   col3  
   4   D   col4  
   5   C   col2  
  </code></pre>
  
  <p>I'd like to create four additional columns based on unique values in <code>foo</code> column. <code>col1</code>,<code>col2</code>, <code>col3</code>, <code>col4</code></p>
  
  <pre><code>     id  foo   col1 col2 col3 col4
   0   A   col1   75   20   5    0
   1   A   col2   20   80   0    0
   2   B   col1   82   10   8    0
   3   B   col3   5    4   80   11
   4   D   col4   0    5   10   85
   5   C   col2   12   78   5    5
  </code></pre>
  
  <p>The logic for creating the columns is as follows:</p>
  
  <p>if <code>foo</code> = <code>col1</code> then <code>col1</code> contains a random number between <code>75-100</code> and the other columns (<code>col2</code>, <code>col3</code>, <code>col4</code>) contains random numbers, such that the total for each row is <code>100</code></p>
  
  <p>I can manually create a new column and assign a random number, but I'm unsure how to include the logic of sum for each row of 100.</p>
  
  <p>Appreciate any help!</p>