title: New Dataframe column based on if statement and other columns
body: <p>I am working with the below dataframe, called df_atr_check: </p>
  
  <pre><code>Symbol  Average Price   ATR Quantity
  SBUX          56          2       100
  AAPL         150          3      -200
  GOOG         700          4       300
  </code></pre>
  
  <p>I am trying to create a new column in my data frame with the name "Mental Stop". </p>
  
  <p>Conditions are very straight forward:
  If the quantity is > 0, then the Mental Stop value will be "Average Price" - "ATR", else, it will be "Average Price" + "ATR".</p>
  
  <p>I am trying to use a Lambda function here, however, it doesn't return a value for me. Please let me know what I am doing wrong.</p>
  
  <pre><code>df_atr_check["Mental Stop"] = lambda x: (df_atr_check["Average Price"] - df_atr_check["ATR Multiple"]) if df_atr_check["Quantity"] &gt; 0 else (df_atr_check["Average Price"] + df_atr_check["ATR Multiple"])
  </code></pre>
  
  <p>Thanks, </p>