pandas data randomise code example Example: python randomize a dataframe pandas df = df.sample(frac=1).reset_index(drop=True)