title: How can I bloat a numpy matrix?
body: <p>Given an input matrix, is there a solution without for loops to bloat it up into a new output matrix, such that between each entry element there's <code>d</code> elements of value 0?</p>
  
  <p>Example:</p>
  
  <p>Input:</p>
  
  <pre><code>A=[[a11,a12,a13]
     [a21,a22,a23]
     [a31,a32,a33]]
  d=2
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>B=[[a11, 0, 0,a12, 0, 0,a13]
     [  0, 0, 0,  0, 0, 0,  0]
     [  0, 0, 0,  0, 0, 0,  0]
     [a21, 0, 0,a22, 0, 0,a23]
     [  0, 0, 0,  0, 0, 0,  0]
     [  0, 0, 0,  0, 0, 0,  0]
     [a31, 0, 0,a32, 0, 0,a33]]
  </code></pre>
  
  <p>My way was using <code>numpy.zeros()</code> in the shape and placing the elements on their spots via 2 loops. (Well, 3 actually, because I did this for 3-dimensional arrays.)</p>