You can use concat
with axis=1
, but first repeat values for match maximal lengths of rows:
dfs = [data1, data2, data3, data4]
maxlen = len(max(dfs, key=len))
print (maxlen)
4
dfs = [pd.concat([x] * int(np.ceil(maxlen / len(x))), ignore_index=True).iloc[:maxlen]
for x in dfs]
data5 = pd.concat(dfs, axis=1)
print (data5)
Col Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8
0 33 44 33 22 33 22 33 22 44
1 44 55 44 22 44 22 33 22 44
2 55 55 33 22 44 44 33 22 44
3 67 555 44 22 33 22 33 22 44
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…