Message303683
Code to reproduce problem:
population = list(range(10))
weights = list(-1 * w for w in range(10))
[random.choices(population, weights) for _ in range(1000)]
will raise IndexError:
358 bisect = _bisect.bisect
359 total = cum_weights[-1]
--> 360 return [population[bisect(cum_weights, random() * total)] for i in range(k)]
361
362 ## -------------------- real-valued distributions -------------------
IndexError: list index out of range |
|
Date |
User |
Action |
Args |
2017-10-04 12:53:19 | ariddell | set | recipients:
+ ariddell |
2017-10-04 12:53:19 | ariddell | set | messageid: <1507121599.13.0.213398074469.issue31689@psf.upfronthosting.co.za> |
2017-10-04 12:53:19 | ariddell | link | issue31689 messages |
2017-10-04 12:53:18 | ariddell | create | |
|