title: Combination of 1 and 0 in an array in Python
body: <p>I want to make a combination of 1's and 0's in a 2d array like the following:</p>
  
  <pre><code>[[ 1, 1, 1, 1, 0, 0, 0, 0 ],
   [ 1, 1, 1, 0, 1, 0, 0, 0 ],
   [ 1, 1, 1, 0, 0, 1, 0, 0 ],
   [ 1, 1, 1, 0, 0, 0, 1, 0 ],
   [ 1, 1, 1, 0, 0, 0, 0, 1 ],
   .
   .
   .
  ]
  </code></pre>
  
  <p>That means a combination of four 1's and four 0's. I have looked at the <code>itertools</code> module's <code>permutations()</code> and <code>combinations()</code>, but couldn't find any suitable functions to perform this combination.</p>