How do you store an entire array into another array
<p>How do you store an entire array into another array</p>

<p>suppose I have an array </p>

<pre><code>data = np.array([], dtype=float, ndmin=2)
a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
</code></pre>

<p>How do you store the values such that</p>

<pre><code>data = [ [1,2,3],
         [4,5,6] ]
</code></pre>

<p>My current method is </p>

<pre><code>data= np.append(data, a)
data= np.append(data, b)
</code></pre>

<p>However this results in [ 1,2,3,4,6]</p>

<p>So you are looking for <code>np.vstack</code>:</p>

<pre><code>a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
data = np.vstack([a,b])
</code></pre>

python arrays numpy