I am trying to get a matrix of size (1000, 7) in which each row is a random permutation of the numbers 0 to 6.
I am using the following code to implement the requirement.
import numpy as np
permute_array = []
for i in range(1000):
permute_array.append(np.random.permutation(7))
permute_array = np.array(permute_array)
This is slow as the for loop takes quite some time to run. Is there a one shot way of generating this array? Thanks.