Vstack over an empty array
<p>Giving this code: </p>

<pre><code>import numpy as np
array1 = []

for i in range(10):
    array1 = np.vstack((array1,i))
</code></pre>

<p>Is there a way to do this without having to treat the first case specifically?
In my real code i have to iterate over 100000 times, so It feels to me that including something like this:</p>

<pre><code>import numpy as np
array1 = []

for i in range(10):
    if np.size(array1)==0:
        array1 = np.append(array1,i)
    else:
        array1 = np.vstack((array1,i))
</code></pre>

<p>would bé a very ineficient way to solve it.</p>

<p><strong>Is there anyway of making this step more eficient?</strong> </p>

<p>Edit: The code is just a simplifyed version of the code, here im just vtacking simple numbers. In the real code I stack arrays of 2 values so final array gives something like:</p>

<pre><code>out_array = [[0.5,0.1],[0.2,0.1],...]
</code></pre>