Message196603
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)] |
|
Date |
User |
Action |
Args |
2013-08-31 00:23:49 | madison.may | set | recipients:
+ madison.may |
2013-08-31 00:23:49 | madison.may | set | messageid: <1377908629.62.0.534510987475.issue18888@psf.upfronthosting.co.za> |
2013-08-31 00:23:49 | madison.may | link | issue18888 messages |
2013-08-31 00:23:47 | madison.may | create | |
|