title: Lambda including if...elif...else
body: <p>I want to apply a lambda function to a DataFrame column using if...elif...else within the lambda function.</p>
  <p>The df and the code are something like:</p>
  <pre><code>df=pd.DataFrame({&quot;one&quot;:[1,2,3,4,5],&quot;two&quot;:[6,7,8,9,10]})
  
  df[&quot;one&quot;].apply(lambda x: x*10 if x&lt;2 elif x&lt;4 x**2 else x+10)
  </code></pre>
  <p>Obviously, this doesn't work. Is there a way to apply if....elif....else to a lambda?
  How can I get the same result with List Comprehension?</p>