Difference between numpy.float and numpy.float64
<p>There seems to be a subtle difference between numpy.float and numpy.float64.</p>

<pre><code>&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; isinstance(2.0, np.float)
True
&gt;&gt;&gt; isinstance(2.0, np.float64)
False
</code></pre>

<p>Can someone clarify this? Thanks</p>

<p><code>np.float</code> is an alias for python <code>float</code> type. 
<code>np.float32</code> and <code>np.float64</code> are numpy specific 32 and 64-bit float types.</p>

<pre><code>float?
Init signature: float(self, /, *args, **kwargs)
Docstring:     
float(x) -&gt; floating point number

Convert a string or number to a floating point number, if possible.
Type:           type

np.float?
Init signature: np.float(self, /, *args, **kwargs)
Docstring:     
float(x) -&gt; floating point number

Convert a string or number to a floating point number, if possible.
Type:           type

np.float32?
Init signature: np.float32(self, /, *args, **kwargs)
Docstring:      32-bit floating-point number. Character code 'f'. C float compatible.
File:           c:\python\lib\site-packages\numpy\__init__.py
Type:           type

np.float64?
Init signature: np.float64(self, /, *args, **kwargs)
Docstring:      64-bit floating-point number. Character code 'd'. Python float compatible.
File:           c:\python\lib\site-packages\numpy\__init__.py
Type:           type
</code></pre>

<p>Thus, when you do <code>isinstance(2.0, np.float)</code>, it is equivalent to <code>isinstance(2.0, float)</code> as 2.0 is a plain python built-in float type... and not the numpy type.</p>

<p><code>isinstance(np.float64(2.0), np.float64)</code> would obviously be <code>True</code>.</p>

python numpy types