You can shuffle with the following one line.
df.sample(frac=1).reset_index(drop=True)
python - Shuffle DataFrame rows - Stack Overflow
Recommended Posts