SyntaxFix
Write A Post
Hire A Developer
Questions
Here is another way:
df['rnd'] = np.random.rand(len(df)) df = df.sort_values(by='rnd', inplace=True).drop('rnd', axis=1)