Steven Basart added the comment:
Left in a line of code that was supposed to be removed. Fixed.
--
Added file: http://bugs.python.org/file42393/weighted_choice_v5.patch
___
Python tracker
<http://bugs.python.org/issue18
Changes by Steven Basart :
Removed file: http://bugs.python.org/file42392/weighted_choice_v5.patch
___
Python tracker
<http://bugs.python.org/issue18844>
___
___
Pytho
Steven Basart added the comment:
Re-implemented with suggested improvements taken into account. Thanks
@mark.dickinson and @pitrou for the suggestions.
I also removed the redundant "fast path" portion for this code since it doesn't
deal with generators anyways.
Let me
Steven Basart added the comment:
I reuploaded the file. The spacing on the if amount < 1 was off. Hopefully
its fixed now.
--
Added file: http://bugs.python.org/file42386/weighted_choice_v4.patch
___
Python tracker
<http://bugs.pyth
Changes by Steven Basart :
Removed file: http://bugs.python.org/file42385/weighted_choice_v4.patch
___
Python tracker
<http://bugs.python.org/issue18844>
___
___
Pytho
Steven Basart added the comment:
Okay so I added a few lines of code. One to make it return a single number if
amount == 1 and the other to check that the amount > 1.
The main difference I've noticed between this implementation and previous
versions compared to say R is that i
Steven Basart added the comment:
Hey serhiy.storchaka
I can edit the code to output just one value if called with simply a list and
then return a list of values if called with the optional amount parameter. My
code also needs to check that amount >= 1.
My code was mostly just to rest
Steven Basart added the comment:
Hello rhettinger. I filled out the form thanks for letting me know about it.
Is there anything else I have to do?
Hey serhiy.storchaka
There were several things "wrong" with the previous implementation in my
opinion.
1st they tried to add too mu
Steven Basart added the comment:
The entire function of weighted choice. I removed the generator and replaced it
by adding an optional argument to specify an amount by which you want to call
this function.
--
Added file: http://bugs.python.org/file42323/weighted_choice_v3.patch
Steven Basart added the comment:
Reopen this idea but removing the generator from weighted choice.
--
nosy: +progressive-o
Added file: http://bugs.python.org/file42322/weighted_choice_v3.diff
___
Python tracker
<http://bugs.python.org/issue18
10 matches
Mail list logo