set the same index than other dataframe code example Example: use the index of a dataframe for another dataframe df2 = pd.DataFrame(df2,index=df1.index)