If I want to generate a string of random bits with equal probability I run

random.randint(0,2,size).

What if I want a specific proportion of bits? In other words, each bit is 1
with probability p<1/2 and 0 with probability q=1-p?

thanks
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to