xxxxxxxxxx
import pandas as pd
# Create two dataframes with overlapping column names
df1 = pd.DataFrame({'A': [1, 2, 3], 'common': ['x', 'y', 'z']})
df2 = pd.DataFrame({'B': [4, 5, 6], 'common': ['p', 'q', 'r']})
# Add a prefix to the columns of each dataframe
df1 = df1.add_prefix('left_')
df2 = df2.add_prefix('right_')
# Merge the dataframes
merged_df = pd.merge(df1, df2, left_on='left_common', right_on='right_common')
print(merged_df)