pandas order dataframe by index of other dataframe code example
Example 1: pandas sort dataframe by index
df.sort_index()
Example 2: pandas order dataframe by index of other dataframe
df2 = df2.reindex(df1.index) # reorder df2 by index of df1
df.sort_index()
df2 = df2.reindex(df1.index) # reorder df2 by index of df1