title: How to duplicate a specific value in a list/array?
body: <p>Any advice on how to repeat a certain value in an array in Python?
  For instance, I want to repeat only 2 in <code>array_a</code>:</p>
  
  <pre><code>array_a = [1, 2, 1, 2, 1, 1, 2]
  </code></pre>
  
  <p>Wanted outcome is: I repeat each <code>2</code> and leave the <code>1</code>:</p>
  
  <pre><code>array_a = [1, 2, 2, 1, 2, 2, 1, 1, 2, 2]  # only the `2` should be repeated
  </code></pre>
  
  <p>I tried <code>numpy</code> and I could duplicate the <em>entire array</em> but not a certain value.</p>