title: numpy: Append row to a individual 3D array
body: <p>There's numerous posts and blogs talking about how to manipulate 2D arrays using append, vstack or concatenate, but I couldn't make it work in 3D.</p>
  
  <p>Problem Assumptions:</p>
  
  <p>--The 3D array will have the shape (k, m, 2).</p>
  
  <p>--k will be a known value</p>
  
  <p>--m could range from 1 to n and is not predetermined</p>
  
  <pre><code>In [1]: import numpy as np
  
  In [2]: a = np.empty((3, 1, 2))
  Out[2]:
  array([[[0., 0.]],
         [[0., 0.]],
         [[0., 0.]]])
  
  In [3]: a[0] = [[5, 6]]
  
  In [4]: a
  Out[4]:
  array([[[5., 6.]],
         [[0., 0.]],
         [[0., 0.]]])
  
  In [5]: a[0] = np.vstack((a[0], [[10, 15]]))
  Out[5]:
  ValueError: could not broadcast input array from shape (2,2) into shape(1,2)
  
  In [6]: a[0] = np.append(a[0], [[10, 15]], axis=0)
  Out[6]:
  ValueError: could not broadcast input array from shape (2,2) into shape(1,2)
  </code></pre>
  
  <p>The desired output would be.</p>
  
  <pre><code>array([[[5., 6.  ]
          [10., 15.]],
          [[0., 0.]],
          [[0., 0.]]])
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Clarification:</p>
  
  <p>The output I was looking for would be like this.</p>
  
  <pre><code>[[[ 5,  6],
    [10, 15]],
  
   [[ 0,  0]],
  
   [[ 0,  0]]]
  </code></pre>
  
  <p>Kyle Booth's response gets close with:</p>
  
  <pre><code>c = np.insert(a, 1, b, axis=1)
  
  [[[ 5,  6],
    [10, 15]],
  
   [[ 0,  0],
    [10, 15]],
  
   [[ 0,  0],
    [10, 15]]]
  </code></pre>