In python, random.choices()
will select K items from a list with replacement, which means that there are may be duplicated items
in the result list. If you want to select K random item from the list without duplication, you need to use
random.sample()
instead.
I wasted one hour debugging this issue and suddenly found the casue. Sad :[