Shuffle DataFrame rows
The idiomatic way to do this with Pandas is to use the .sample method of your data frame to sample all rows without replacement: df.sample(frac=1) The frac keyword argument specifies the fraction of rows to return in the random sample, so frac=1 means to return all rows (in random order). Note: If you wish to … Read more