import pandas as pd
from functools import reduce
# compile the list of dataframes you want to merge
data_frames = [df1, df2, df3]
df_merged = reduce(lambda left,right: pd.merge(left,right,on=['key_col'],
how='outer'), data_frames)
In [9]: result = pd.concat([df1, df4], axis=1)
In [12]:
pd.concat([df,df1], axis=0, ignore_index=True)
Out[12]:
attr_1 attr_2 attr_3 id quantity
0 0 1 NaN 1 20
1 1 1 NaN 2 23
2 1 1 NaN 3 19
3 0 0 NaN 4 19
4 1 NaN 0 5 8
5 0 NaN 1 6 13
6 1 NaN 1 7 20
7 1 NaN 1 8 25
df = df1.append(df2)
df = pd.concat([df1, df2, df3, df4], axis=1)