I want to to generate pairs of random numbers that first number is smaller than second one like [[3 8] [2 5] [8 9] [8 10] [5 9] [3 7]]. I tried with following code but since all the values generated randomly some of the first elements are greater than second ones and some of them are equal.
a=random.randint(1, 10)
b = np.random.randint(1,10,(a,2))
print(b)
Aucun commentaire:
Enregistrer un commentaire