Is it possible to modify the numpy.random.choice function in order to make it return the index of the chosen element? Basically, I want to create a list and select elements ran
Instead of using choice, you can also simply random.shuffle your array, i.e.
choice
random.shuffle(a) # will shuffle a in-place