Peter Otten wrote:
Scott David Daniels wrote:
[a real correction and a bogus one]
raise ValueError('Samplng more than %d without replacement?' % (
sum(1 for w in weights)))
That would be len(weights)
Yup, probably I should have just saved len(combined).
but I think your first version was correct; I don't see were you remove the
0-items from weights.
You are right. I thought I was looking at combined on the second,
realized my mistake, and thought, Oh well, it'll work out later.
The other mistake wasn't too bad either, as all that would happen
is that an internal exception would get raised, any answers delivered
are delivered with the correct probabilities.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list