<p dir="auto">Hard to reproduce. I attached an array where this happens:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
np.seterr(all='raise')
a = np.load('weird_array.npy')
print(a.shape, a.dtype)
for i, val in enumerate(a):
    try:
        np.isfinite(np.array(val, ndmin=1))
    except:
        strange_index = i
        print(type(val))
        print(val.__class__.__name__)
        print(i)
        print(val)

print(np.isfinite(a[strange_index]))
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-s1">np</span>.<span class="pl-en">seterr</span>(<span class="pl-s1">all</span><span class="pl-c1">=</span><span class="pl-s">'raise'</span>)
<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">load</span>(<span class="pl-s">'weird_array.npy'</span>)
<span class="pl-en">print</span>(<span class="pl-s1">a</span>.<span class="pl-s1">shape</span>, <span class="pl-s1">a</span>.<span class="pl-s1">dtype</span>)
<span class="pl-k">for</span> <span class="pl-s1">i</span>, <span class="pl-s1">val</span> <span class="pl-c1">in</span> <span class="pl-en">enumerate</span>(<span class="pl-s1">a</span>):
    <span class="pl-k">try</span>:
        <span class="pl-s1">np</span>.<span class="pl-en">isfinite</span>(<span class="pl-s1">np</span>.<span class="pl-en">array</span>(<span class="pl-s1">val</span>, <span class="pl-s1">ndmin</span><span class="pl-c1">=</span><span class="pl-c1">1</span>))
    <span class="pl-k">except</span>:
        <span class="pl-s1">strange_index</span> <span class="pl-c1">=</span> <span class="pl-s1">i</span>
        <span class="pl-en">print</span>(<span class="pl-en">type</span>(<span class="pl-s1">val</span>))
        <span class="pl-en">print</span>(<span class="pl-s1">val</span>.<span class="pl-s1">__class__</span>.<span class="pl-s1">__name__</span>)
        <span class="pl-en">print</span>(<span class="pl-s1">i</span>)
        <span class="pl-en">print</span>(<span class="pl-s1">val</span>)

<span class="pl-en">print</span>(<span class="pl-s1">np</span>.<span class="pl-en">isfinite</span>(<span class="pl-s1">a</span>[<span class="pl-s1">strange_index</span>]))</pre></div>
<p dir="auto">Results in:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;class 'numpy.float64'&gt;
float64
1023450
nan
Traceback (most recent call last):
  File &quot;test.py&quot;, line 15, in &lt;module&gt;
    print(np.isfinite(a[strange_index]))
FloatingPointError: invalid value encountered in isfinite"><pre class="notranslate"><code class="notranslate">&lt;class 'numpy.float64'&gt;
float64
1023450
nan
Traceback (most recent call last):
  File "test.py", line 15, in &lt;module&gt;
    print(np.isfinite(a[strange_index]))
FloatingPointError: invalid value encountered in isfinite
</code></pre></div>
<p dir="auto"><a href="https://github.com/numpy/numpy/files/365889/weird_array.zip">weird_array.zip</a></p>
<p dir="auto">My code failed with a <code class="notranslate">FloatingPointError</code> because <code class="notranslate">isfinite</code> encountered an invalid value.  The offending value was... <code class="notranslate">nan</code>.  Apparently, it was <em>the wrong kind of nan</em>.  I reproduced it as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# (earlier: seterr(all='raise'))
In [204]: x = uint32(0x7f831681).view(&quot;&lt;f4&quot;)

In [205]: print(x)
nan

In [206]: isnan(x)
---------------------------------------------------------------------------
FloatingPointError                        Traceback (most recent call last)
&lt;ipython-input-206-b5e847e0f3bf&gt; in &lt;module&gt;()
----&gt; 1 isnan(x)

FloatingPointError: invalid value encountered in isnan

In [207]: isfinite(x)
---------------------------------------------------------------------------
FloatingPointError                        Traceback (most recent call last)
&lt;ipython-input-207-3d4ef4d5266d&gt; in &lt;module&gt;()
----&gt; 1 isfinite(x)

FloatingPointError: invalid value encountered in isfinite"><pre class="notranslate"><code class="notranslate"># (earlier: seterr(all='raise'))
In [204]: x = uint32(0x7f831681).view("&lt;f4")

In [205]: print(x)
nan

In [206]: isnan(x)
---------------------------------------------------------------------------
FloatingPointError                        Traceback (most recent call last)
&lt;ipython-input-206-b5e847e0f3bf&gt; in &lt;module&gt;()
----&gt; 1 isnan(x)

FloatingPointError: invalid value encountered in isnan

In [207]: isfinite(x)
---------------------------------------------------------------------------
FloatingPointError                        Traceback (most recent call last)
&lt;ipython-input-207-3d4ef4d5266d&gt; in &lt;module&gt;()
----&gt; 1 isfinite(x)

FloatingPointError: invalid value encountered in isfinite
</code></pre></div>
<p dir="auto">I'm not sure how this ended up in my data, but it was not on purpose.</p>