title: How to use .loc to set as other column values in pandas
body: <p>For example, I have a dataframe:</p>
  
  <pre><code>    cond  value1  value2
  0   True       1       1
  1  False       3       5
  2   True      34       2
  3   True      23      23
  4  False       4       2
  </code></pre>
  
  <p>I hope to replace value1 to <code>value2*2</code> when <code>cond=True</code>. So I want the result is:</p>
  
  <pre><code>    cond  value1  value2
  0   True       2       1
  1  False       3       5
  2   True       4       2
  3   True      46      23
  4  False       4       2
  </code></pre>
  
  <p>I can achieve it by follow code:</p>
  
  <pre><code> def convert(x):
       if x.cond:
           x.value1= x.value2*2
       return x
   data = data.apply(lambda x: convert(x),axis=1)
  </code></pre>
  
  <p>I think it is so slow when data is big. I try it by <code>.loc</code>, but I don't know how to set value.</p>
  
  <p>How can I achieve it by <code>.loc</code> or other simple ways? Thanks in advance.</p>