<p dir="auto">In Python 3, <code class="notranslate">round(_float_)</code> returns an <strong>integer</strong>, but <code class="notranslate">round(_np.float64_)</code> returns a <strong>float</strong>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; np.float64(1).__round__()
1.0
&gt;&gt;&gt; 1.0.__round__()
1"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; np.float64(1).__round__()
1.0
&gt;&gt;&gt; 1.0.__round__()
1
</code></pre></div>
<p dir="auto">The result is that if a <a href="https://docs.scipy.org/doc/numpy/user/basics.types.html" rel="nofollow"><code class="notranslate">np.float64</code></a> seeps into my data, the stock <a href="https://docs.python.org/3/library/functions.html#round" rel="nofollow"><code class="notranslate">round</code></a> produces unexpected results: <code class="notranslate">round(x)</code> can be an integer or a float depending on whether <code class="notranslate">x</code> is a regular <code class="notranslate">float</code> or a <code class="notranslate">np.float64</code>.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; [type(round(t(1))).__name__ for t in [float, np.float16, np.float32, np.float64, np.float128]]
['int', 'float16', 'float32', 'float64', 'float128']"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; [type(round(t(1))).__name__ for t in [float, np.float16, np.float32, np.float64, np.float128]]
['int', 'float16', 'float32', 'float64', 'float128']
</code></pre></div>
<p dir="auto">The distinction does matter, e.g., <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.partition.html" rel="nofollow"><code class="notranslate">np.partition</code></a> raises <code class="notranslate">TypeError: Partition index must be integer</code>.</p>
<p dir="auto">PS. Python 3.7.0, numpy 1.14.5</p>
<p dir="auto">Unlike Python2, Python3's (builtin) round function is documented to return an integer when called with a single argument.  However, numpy float dtypes do not satisfy this, returning a float instead.</p>