python .merge documentation code example
Example 1: merge on index pandas
pd.merge(df1, df2, left_index=True, right_index=True)
Example 2: merge dataframe
In [46]: result = pd.merge(left, right, how="right", on=["key1", "key2"])
pd.merge(df1, df2, left_index=True, right_index=True)
In [46]: result = pd.merge(left, right, how="right", on=["key1", "key2"])