title: Inserting values into numpy array based on if condition
body: <p>Suppose I have the following array:</p>
  <pre><code>a = np.array([1,0,2,3,0,4,5,0])
  </code></pre>
  <p>for each zero I would like to duplicate a zero and add it to the array such that I get:</p>
  <pre><code>np.array([1,0,0,2,3,0,0,4,5,0,0])
  </code></pre>
  <p>So I did the following:</p>
  <pre><code>for i in range(len(a)):
      if i-1==0 or i==0:
          print(np.insert(a,i,0))
  </code></pre>
  <p>which did not work. I wonder what am I doing wrong?</p>