vendredi 5 juillet 2019

Get random values of a list and and the corresponding values from another list

I have two lists, each of which can have repeated values. Example:

x = [1, 6, 7, 3, 7, 4, 6]
y = [5, 9, 4, 7, 9, 4, 5]

I want to get two new lists (x_random, y_random) with a certain number of random elements (for example: 3) corresponding to each other. Example:

x_random = [1, 6, 6]
y_random = [5, 9, 5]




Aucun commentaire:

Enregistrer un commentaire