reverse dataframe python code example
Example 1: reverse pd based on index
data.iloc[::-1]
Example 2: shuffle dataframe python
df = df.sample(frac=1).reset_index(drop=True)
Example 3: reverse pd based on index
data.reindex(index=data.index[::-1])