[Numpy-discussion] sample without replacement

Alan G Isaac alan.isaac at gmail.com
Mon Dec 20 11:28:47 EST 2010


I want to sample *without* replacement from a vector
(as with Python's random.sample).  I don't see a direct
replacement for this, and I don't want to carry two
PRNG's around.  Is the best way something like  this?

	permutation(myvector)[:samplesize]

Thanks,
Alan Isaac



More information about the NumPy-Discussion mailing list