<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1647" rel="nofollow">http://projects.scipy.org/numpy/ticket/1647</a> on 2010-10-24 by trac user phaustus, assigned to unknown.</em></p>
<p dir="auto">Hi,</p>
<p dir="auto">Under numpy 1.4.1, the output of:</p>
<blockquote>
<p dir="auto">int32(array([0.]))</p>
</blockquote>
<p dir="auto">is simply "0", whereas under numpy 1.3.0, the output is<br>
"array([0], dtype=int32)".  While the former is a number,<br>
the latter is an array.  Interestingly, the output for</p>
<blockquote>
<p dir="auto">int32(array([0.,1.]))</p>
</blockquote>
<p dir="auto">and for</p>
<blockquote>
<p dir="auto">int32(array([]))</p>
</blockquote>
<p dir="auto">is the same in each version (i.e., both return arrays).</p>
<p dir="auto">I apologize if this has already been addressed.  I did a search and found nothing.</p>
<p dir="auto">Cheers,</p>
<p dir="auto">Phaustus</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/764" rel="nofollow">http://projects.scipy.org/numpy/ticket/764</a> on 2008-04-29 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/charris/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/charris">@charris</a>, assigned to unknown.</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: float32(array([[1]]))
Out[1]: array([[ 1.]], dtype=float32)

In [2]: float64(array([[1]]))
Out[2]: 1.0

In [3]: int64(array([[1]]))
Out[3]: array([[1]], dtype=int64)

In [4]: int32(array([[1]]))
Out[4]: 1"><pre class="notranslate"><code class="notranslate">In [1]: float32(array([[1]]))
Out[1]: array([[ 1.]], dtype=float32)

In [2]: float64(array([[1]]))
Out[2]: 1.0

In [3]: int64(array([[1]]))
Out[3]: array([[1]], dtype=int64)

In [4]: int32(array([[1]]))
Out[4]: 1
</code></pre></div>
<p dir="auto">But also</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [5]: float64([[1]])
Out[5]: array([[ 1.]])

In [6]: int32([[1]])
Out[6]: array([[1]])"><pre class="notranslate"><code class="notranslate">In [5]: float64([[1]])
Out[5]: array([[ 1.]])

In [6]: int32([[1]])
Out[6]: array([[1]])
</code></pre></div>