title: Apply lambda depending on column values on Pandas
body: <p>I have a data frame that depending on the value of column <code>Order</code> I want to take the value of column <code>Value</code> and do some calculation.</p>
  
  <p><strong>DataFrame1</strong></p>
  
  <pre><code>             Order  Shares   Value
  2011-01-10   BUY    1300     340.99  
  2011-01-10   SELL   1200     340.99
  2011-01-11   SELL   1100     330.99   
  </code></pre>
  
  <p>Line of code:</p>
  
  <pre><code>impacts['NewValue']=float(impacts.Order.apply(lambda x: (impacts.Value + (impacts.Value * 0.006)) if x == 'SELL' else (impacts.Value - (impacts.Value * 0.006))))
  </code></pre>
  
  <p>Error:</p>
  
  <p><em>TypeError: ufunc 'multiply' did not contain a loop with signature matching types dtype('S32') dtype('S32') dtype('S32')</em></p>
  
  <p>Is my understanding that error is caused by the contents of the numbers, therefore that's why I tried to cast it to a float.</p>
  
  <p><strong>Intended output</strong></p>
  
  <pre><code>            Order  Shares   Value   NewValue
  2011-01-10   BUY    1300   340.99  338.94
  2011-01-10   SELL   1200   340.99  343.03
  2011-01-11   SELL   1100   330.99  332.97
  </code></pre>
  
  <p>Any help is more than welcome. Thanks!</p>