title: Difference between nan and 'nan' in Python
body: <p>I have two lists </p>
  
  <pre><code>a = ['E300' 'E407' 'nan' 'nan' 'nan' 'nan' 'nan' 'nan' 'nan' 'nan' ]
  b = [ nan  nan  nan  nan  nan  nan  nan  nan  nan  nan  nan  nan  nan]
  </code></pre>
  
  <p>I wanted to remove nan from the lists. So I used this on list 'a' and 'b'</p>
  
  <pre><code>a = [x for x in a if x != 'nan']
  b = [x for x in b if x != 'nan']
  </code></pre>
  
  <p>So it works fine for list 'a' because I think it was taking 'nan' as a string but not with list b. How can I remove those nan from list b. Thanks in advance.</p>