Generate conditioned random binary array matrix in python
<p>what could be the most efficient way to generate a mxn binary array matrix which is contrained to the sum per column is equal 0 or 1 ?</p>

<p>somethin like this</p>

<pre><code>[[0,0,1,0,0],
[1,1,0,0,0],
[0,0,0,0,1]
[0,0,0,0,0]]
</code></pre>

<p>m and n are going to be fixed, but n is larger than 500000 so iteration methods could take a long time until an appropied matrix is found.</p>