How to transfer one column in pandas
2 answers
Use numpy.random.permutation
:
df['X1'] = np.random.permutation(df['X1'])
print (df)
X1 X2 Y
0 3 2 1
1 2 4 0
2 1 6 1
+3
source to share