How can I generate a list of tuples whose elements are not repeated? In addition, if there is (a,b) tuple in list, (b,a) would not be generated in this list.
I use code below from here, but it doesn't provide second condition:
[tuple(i) for i in np.random.randint(5242, size=(500,2))]
Aucun commentaire:
Enregistrer un commentaire