diff options
author | Raymond Hettinger <python@rcn.com> | 2002-11-12 17:41:57 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-11-12 17:41:57 (GMT) |
commit | f24eb35d185c0623315cfbd9977d37c509860dcf (patch) | |
tree | 336a055089a3bd51d89bf4fdc987fb90ce743e09 /Misc | |
parent | 3a7ad5c5843467dc67ddf4c6622dd466f0f42c74 (diff) | |
download | cpython-f24eb35d185c0623315cfbd9977d37c509860dcf.zip cpython-f24eb35d185c0623315cfbd9977d37c509860dcf.tar.gz cpython-f24eb35d185c0623315cfbd9977d37c509860dcf.tar.bz2 |
SF patch 629637: Add sample(population, k) method to the random module.
Used for random sampling without replacement.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -427,6 +427,9 @@ Library - Added operator.pow(a,b) which is equivalent to a**b. +- Added random.sample(population,k) for random sampling without replacement. + Returns a k length list of unique elements chosen from the population. + - random.randrange(-sys.maxint-1, sys.maxint) no longer raises OverflowError. That is, it now accepts any combination of 'start' and 'stop' arguments so long as each is in the range of Python's |