merge on index pandas dataframe code example Example: merge on index pandas pd.merge(df1, df2, left_index=True, right_index=True)