title: Lambda function inside map pandas
body: <p>I am unable to comprehend the structure of this if else if else in the lambda function defined below. Particularly - the part :</p>
  
  <pre><code>if x != x
  </code></pre>
  
  <p>In this code :</p>
  
  <pre><code>check['Id'].map(lambda x: x if x != x else (str(x)[:str(x).rfind('.0')] if str(x).rfind('.0') != -1 else str(x))
  </code></pre>
  
  <p>PS: I get that above code is formatting the ID value and returning a string without the decimal that could be there in the input. </p>