title: Stack the same row in each layer of a 3D numpy array
body: <p>Hi is there a way to efficiently stack the same row in each layer of a 3D numpy array? I have an array like this:</p>
  <pre><code> a = np.array([[[&quot;a111&quot;,&quot;a112&quot;,&quot;a113&quot;],
                  [&quot;b&quot;,&quot;b&quot;,&quot;b&quot;],
                  [&quot;c&quot;,&quot;c&quot;,&quot;c&quot;],
                  [&quot;d&quot;,&quot;d&quot;,&quot;d&quot;]],
                 [[&quot;a211&quot;,&quot;a212&quot;,&quot;a213&quot;],
                  [&quot;b&quot;,&quot;b&quot;,&quot;b&quot;],
                  [&quot;c&quot;,&quot;c&quot;,&quot;c&quot;],
                  [&quot;d&quot;,&quot;d&quot;,&quot;d&quot;]],
                [[&quot;a311&quot;,&quot;a312&quot;,&quot;a313&quot;],
                  [&quot;b&quot;,&quot;b&quot;,&quot;b&quot;],
                  [&quot;c&quot;,&quot;c&quot;,&quot;c&quot;],
                  [&quot;d&quot;,&quot;d&quot;,&quot;d&quot;]],
               [[&quot;a411&quot;,&quot;a412&quot;,&quot;a413&quot;],
                  [&quot;b&quot;,&quot;b&quot;,&quot;b&quot;],
                  [&quot;c&quot;,&quot;c&quot;,&quot;c&quot;],
                  [&quot;d&quot;,&quot;d&quot;,&quot;d&quot;]]])
  </code></pre>
  <p><strong>and i want to get something like this:</strong></p>
  <pre><code>np.array([[[&quot;a111&quot;,&quot;a112&quot;,&quot;a113&quot;],
                  [&quot;a211&quot;,&quot;a212&quot;,&quot;a213&quot;],
                  [&quot;a311&quot;,&quot;a312&quot;,&quot;a313&quot;],
                  [&quot;a411&quot;,&quot;a412&quot;,&quot;a413&quot;]],
                 [[&quot;b&quot;,&quot;b&quot;,&quot;b&quot;],
                  [&quot;b&quot;,&quot;b&quot;,&quot;b&quot;],
                  [&quot;b&quot;,&quot;b&quot;,&quot;b&quot;],
                  [&quot;b&quot;,&quot;b&quot;,&quot;b&quot;]],
                 [[&quot;c&quot;,&quot;c&quot;,&quot;c&quot;],
                  [&quot;c&quot;,&quot;c&quot;,&quot;c&quot;],
                  [&quot;c&quot;,&quot;c&quot;,&quot;c&quot;],
                  [&quot;c&quot;,&quot;c&quot;,&quot;c&quot;]],
                 [[&quot;d&quot;,&quot;d&quot;,&quot;d&quot;],
                  [&quot;d&quot;,&quot;d&quot;,&quot;d&quot;],
                  [&quot;d&quot;,&quot;d&quot;,&quot;d&quot;],
                  [&quot;d&quot;,&quot;d&quot;,&quot;d&quot;]]])
  </code></pre>
  <p>Right now I'm looping through the whole array and stacking it manually.</p>