pandas df shuffle rows code example
Example 1: pandas shuffle rows
df = df.sample(frac=1).reset_index(drop=True)
Example 2: how to merge rows in pandas dataframe
df = dataframe.groupby(['date', 'sitename', 'name']).sum()
df = df.sample(frac=1).reset_index(drop=True)
df = dataframe.groupby(['date', 'sitename', 'name']).sum()