title: Perform a conditional operation on a pandas column
body: <p>I know that this should be simple, but I want to take a column from a pandas
  dataframe, and for only the entries which meet some condition (say less than 1),
  multiply by a scalar (say 2).</p>
  
  <p>For example, in this dataframe,</p>
  
  <pre><code>df = pd.DataFrame(randn(5,4),index='A B C D E'.split(),columns='W X Y Z'.split())
  
            W         X       Y        Z  
  
  A    2.706850 0.628133 0.907969 0.503826 
  B    0.651118 -0.319318 -0.848077 0.605965 
  C    -2.018168 0.740122 0.528813 -0.589001 
  D    0.188695 -0.758872 -0.933237 0.955057 
  E    0.190794 1.978757 2.605967 0.683509 
  </code></pre>
  
  <p>if I'm interested in carrying out this operation on column <code>W</code>, the result should be</p>
  
  <pre><code>          W         X       Y        Z  
  
  A    2.706850 0.628133 0.907969 0.503826 
  B    1.302236 -0.319318 -0.848077 0.605965 
  C    -4.036336 0.740122 0.528813 -0.589001 
  D    0.37739 -0.758872 -0.933237 0.955057 
  E    0.381588 1.978757 2.605967 0.683509
  </code></pre>
  
  <p>I have the below for an absolute assignment:</p>
  
  <pre><code>df.loc[df['W'] &lt; 1, 'W'] = 4
  </code></pre>
  
  <p>but I'm not sure how to use the actual values from <code>W</code>.</p>
  
  <p>Thanks in advance!</p>