shawnberry added the comment:
Hi PSF,
Upon further review, random.choices() is O(N). I was looping through the
values in random.choices() to make it O(N**2) in my code.
Next time I will thoroughly check a function on its own before raising any
issue. Fyi, BIF is built-in function. Please
New submission from shawnberry :
Please see my GitHub page
https://github.com/shawnberry/Improved_random.choices/blob/master/Improved_Py3_BIF_random_dot_choices.py
for code that reduces Py3 BIF random.choices() from O(N**2) to O(N).
This is my first suggestion to improve Python code.
Thanks