title: Shuffle column in panda dataframe with groupby
body: <p>I want to randomly shuffle the values for one single column of a dataframe based on a groupby. E.g., I have two columns A and B. Now, I want to randomly shuffle column B based on a groupby on A.</p>
  
  <p>For an example, suppose that there are three distinct values in A. Now for each distinct value of A, I want to shuffle the values in B, but just with values having the same A.</p>
  
  <p>Example input:</p>
  
  <pre><code>A       B     
  ------------
  1       1          
  1       3    
  2       4     
  3       6   
  1       2  
  3       5   
  </code></pre>
  
  <p>Example output:</p>
  
  <pre><code>A       B        
  ------------
  1       3          
  1       2    
  2       4     
  3       6   
  1       1  
  3       5  
  </code></pre>
  
  <p>In this case, for <code>A=1</code> the values for B got shuffled. The same happened for <code>A=2</code>, but as there is only one row it stayed like it was. For <code>A=3</code> by chance the values for B also stayed like they were.</p>
  
  <p>I want to achieve it with Pandas.</p>