vendredi 21 décembre 2018

How do I randomize a pandas column in the same order every time I run the code in Python?

This is my code:

random_idx = np.random.permutation(len(cIds))
train_Ids = cIds[random_idx[:train_size]]

Now, I want the list to be randomized in the same order every time I run this line of code.

Note: I do not want to save random_idx variable in a text file, and fetch the same list.




Aucun commentaire:

Enregistrer un commentaire