title: Expanding a numpy array of matrices with zeros
body: <p>What's the most efficient way to pad an array of matrices with zeros?</p>
  
  <p>example:</p>
  
  <pre><code># Lets construct an array of 2 matrices from 3 arrays of vectors
  import numpy as np
  
  A = np.array([[0,1,2],[3,4,5]])       # 2 vectors
  B = np.array([[6,7,8],[9,10,11]])     # 2 vectors
  C = np.array([[12,13,14],[15,16,17]]) # 2 vectors
  M = np.dstack((A,B,C))
  '''
  # Result: array([[[ 0,  6, 12],
                    [ 1,  7, 13],
                    [ 2,  8, 14]],
  
                   [[ 3,  9, 15],
                    [ 4, 10, 16],
                    [ 5, 11, 17]]]) #
  '''
  </code></pre>
  
  <p>I want to add a column and/or a row of zeros to every matrix element in the array such as:</p>
  
  <pre><code>'''
  # Result: array([[[ 0,  6, 12, 0],
                [ 1,  7, 13, 0],
                [ 2,  8, 14, 0],
                [ 0,  0,  0, 0]],
  
               [[ 3,  9, 15, 0],
                [ 4, 10, 16, 0],
                [ 5, 11, 17, 0]
                [ 0,  0,  0, 0]]]) #
  '''
  </code></pre>