vendredi 16 mars 2018

Suffle values of columns in the same row

I have a dataframe like this :

In [1]: df
Out[1]: 
  col_1  col_2
0     A      2
1     B      4
2     C      6

and I want to suffle randomly the values in col_1 and col_2 so my new dataframe can be like this :

In [2]: df
Out[2]: 
  col_1  col_2
0     2      A
1     B      4
2     6      C




Aucun commentaire:

Enregistrer un commentaire