Python: numpy data type casting
<p>I'm confused by some output I'm seeing.</p>

<p>If p is a list of floats, what is the difference between:</p>

<pre><code>input = np.array([p]).astype('f')
</code></pre>

<p>and</p>

<pre><code>input = np.array([p],float)
</code></pre>

<p>If I use the second option and then do a print(input), I always get something like:</p>

<p>[array([-0.662,  0.246,  1.029])]</p>

<p>But if I use the first option, sometimes I get simply:
[[ 0.61900002  1.71300006  2.16899991]] </p>

<p>but other times I get the [array([])] form.</p>