title: how to shuffle a binary array a specific amount
body: <p>I have a binary array. I want to shuffle it such that <em>n</em> percent of random elements stay in the same place and the rest get shuffled. Another way of putting it is, I have a binary array and I want to create a second array that is of same length and <em>n</em> percent similar when compared to the first using difflib</p>
  
  <p>I'm using
      <code>random.shuffle</code>
  to shuffle the array but can't find info on the percent part of my question.</p>
  
  <pre><code>import random
  
  array = [1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0]
  random.shuffle(array)
  print(array)
  </code></pre>