generate a 2D array of numpy.random.choice without replacement
问题 I'm tyring to make my code faster by removing some for loops and using arrays. The slowest step right now is the generation of the random lists. context: I have a number of mutations in a chromosome, i want to perform 1000 random "chromosomes" with the same length and same number of mutation but their positions are randomized. here is what I'm currently running to generate these randomized mutation positions: iterations=1000 Chr_size=1000000 num_mut=500 randbps=[] for k in range(iterations):