title: numpy NaN not always recognized
body: <p>This puzzles me:</p>
  
  <pre><code>```
  a=np.array([1,2,np.nan,3])    # an array with a nan
  print(np.isnan(a)[2])         # it truly is a nan
  print(a[2])                   # it quacks like a nan
  print(np.nan is np.nan)       # nan's can be compared
  print(a[2] is np.nan)         # But then, this isn't a nan after all!!??
  
  &gt;&gt;&gt; True
  &gt;&gt;&gt; nan
  &gt;&gt;&gt; True
  &gt;&gt;&gt; False
  ```
  </code></pre>
  
  <p>I know we're not allowed to compare nan's with <code>==</code>, but with <code>is</code> should be allowed? After all it works when comparing nan to itself?</p>
  
  <p>Thanks for any hints to what is going on here.</p>