title: Pandas/Numpy NaN None comparison
body: <p>In Python Pandas and Numpy, why is the comparison result different?</p>
  
  <pre><code>from pandas import Series
  from numpy import NaN
  </code></pre>
  
  <p><code>NaN</code> is not equal to <code>NaN</code></p>
  
  <pre><code>&gt;&gt;&gt; NaN == NaN
  False
  </code></pre>
  
  <p>but <code>NaN</code> inside a list or tuple is</p>
  
  <pre><code>&gt;&gt;&gt; [NaN] == [NaN], (NaN,) == (NaN,)
  (True, True)
  </code></pre>
  
  <p>While <code>Series</code> with <code>NaN</code> are not equal again:</p>
  
  <pre><code>&gt;&gt;&gt; Series([NaN]) == Series([NaN])
  0    False
  dtype: bool
  </code></pre>
  
  <p>And <code>None</code>:</p>
  
  <pre><code>&gt;&gt;&gt; None == None, [None] == [None]
  (True, True)
  </code></pre>
  
  <p>While</p>
  
  <pre><code>&gt;&gt;&gt; Series([None]) == Series([None])
  0    False
  dtype: bool 
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/1565164/what-is-the-rationale-for-all-comparisons-returning-false-for-ieee754-nan-values">This answer</a> explains the reasons for <code>NaN == NaN</code> being <code>False</code> in general, but does not explain its behaviour in python/pandas collections.</p>