This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author madison.may
Recipients madison.may
Date 2013-08-31.00:23:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377908629.62.0.534510987475.issue18888@psf.upfronthosting.co.za>
In-reply-to
Content
Although the random module supports random sampling without replacement, there is no support for random sampling with replacement.  Efficient random sampling with replacement is trivial using random.choice() (see below), but supporting it as an optional 'replace' arg to random.sample() might be nice for symmetry. 

array = range(100)
random_sample = [random.choice(array) for i in range(10)]
History
Date User Action Args
2013-08-31 00:23:49madison.maysetrecipients: + madison.may
2013-08-31 00:23:49madison.maysetmessageid: <1377908629.62.0.534510987475.issue18888@psf.upfronthosting.co.za>
2013-08-31 00:23:49madison.maylinkissue18888 messages
2013-08-31 00:23:47madison.maycreate