pd.merge according to a given index code example Example: merge on index pandas pd.merge(df1, df2, left_index=True, right_index=True)