Message196603
| 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: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 |
|