title: Syntax error in lambda with if expression
body: <pre><code>basic_salary['dem_education_level_numeric']=basic_salary['dem_education_level'].apply(lambda x : 3 if (x == 'high'))
  </code></pre>
  
  <p>I am getting below error:</p>
  
  <pre><code>SyntaxError: invalid syntax (&lt;ipython-input-20-80adac538241&gt;, line 1)
    File "&lt;ipython-input-20-80adac538241&gt;", line 1
      basic_salary['dem_education_level_numeric']=basic_salary['dem_education_level'].apply(lambda x : 3 if (x == 'high'))
                                                                                                                         ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>Please help</p>