merge dataframe by columns using index

In [1]:
import pandas as pd

In [2]:
df = pd.DataFrame([[1, 3], [2, 4]], columns=['A', 'B'])
df


Out[2]:
A B
0 1 3
1 2 4

In [3]:
df2 = pd.DataFrame([[1, 5], [1, 6]], columns=['A', 'D'])
df2


Out[3]:
A D
0 1 5
1 1 6

In [4]:
pd.concat([df, df2], axis=1)


Out[4]:
A B A D
0 1 3 1 5
1 2 4 1 6

In [ ]: