df1
df2
Concatenate horizontally by setting the axis
parameter to columns or 1.
pd.concat([df1, df2], axis=1)
Use the exact index from the original DataFrame.
pd.concat([df1, df2], axis=1).reindex(df1.index)
Keep the rows that have the same index by setting join
to inner.
Label each piece by setting the keys
parameter.
Name each level in the index by setting the names
parameter.
pd.concat([df1, df2], axis='columns',
join='inner', keys=['df1', 'df2'], names=['df', None])