title: Why doesn't numpy.unique recognize that multiple numpy.nan values are identical?
body: <p>I have a short example script:</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  
  print('numpy version:       ', np.version.version)
  
  foo = np.full(10, 5)
  bar = np.full(10, np.nan)
  
  print('foo:                 ', foo)
  print('Unique values of foo:', np.unique(foo))
  
  print('bar:                 ', bar)
  print('Unique values of bar:', np.unique(bar))
  </code></pre>
  
  <p>It prints the following result:</p>
  
  <pre><code>numpy version:        1.16.4
  foo:                  [5 5 5 5 5 5 5 5 5 5]
  Unique values of foo: [5]
  bar:                  [nan nan nan nan nan nan nan nan nan nan]
  Unique values of bar: [nan nan nan nan nan nan nan nan nan nan]
  </code></pre>
  
  <p><strong>My questions:</strong></p>
  
  <ol>
  <li>Why doesn't <code>np.unique()</code> return just a single <code>nan</code> value when it receives <code>bar</code> as input?  Surely this is an error, right?  Or if it's the correct, expected behavior, then why is it correct?</li>
  <li>What is the recommended workaround--if any--for obtaining the more typical behavior as illustrated by <code>foo</code>?</li>
  </ol>