import pandas as pd
df = pd.DataFrame({'a': [1, 2, 3, 4],
'b': ['w', 'x', 'y', 'z']})
df2 = df.copy()
df2 = df2.sample(frac=1).reset_index(drop=True)
print(df2.head())
print(df.equals(df2))
df2 = df2.sort_values(by='a')#.reset_index().drop('index', axis=1)
print(df2.head())
print(df.equals(df2))