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.
Created on 2013年08月31日 00:23 by madison.may, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg196603 - (view) | Author: Madison May (madison.may) * | Date: 2013年08月31日 00:23 | |
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)] |
|||
| msg196626 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2013年08月31日 09:24 | |
This was already considered and rejected in issue18414. |
|||
| msg196631 - (view) | Author: Madison May (madison.may) * | Date: 2013年08月31日 11:30 | |
Whoops, my apologies. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:50 | admin | set | github: 63088 |
| 2013年08月31日 11:30:56 | madison.may | set | messages: + msg196631 |
| 2013年08月31日 09:24:21 | mark.dickinson | set | status: open -> closed nosy: + rhettinger, mark.dickinson messages: + msg196626 superseder: random.choices(seq, k) resolution: duplicate |
| 2013年08月31日 00:23:49 | madison.may | create | |