不能正常连接两个熊猫数据框

时间:2020-10-19 11:21:46

标签: pandas concatenation

我想按列连接两个数据帧(轴= 1)。我以前使用过这种方法,但它确实有效,但现在却无法按预期工作。两个数据帧具有相同的行数。

file= pd.read_excel('xy.xlsx')

for f in os.listdir("../../seed/concat"):

    data = pd.read_excel(f)
    
    conc= pd.concat([file, data],axis=1)

    conc.to_excel("/../seed/concat/" + f, index=False)

一个接一个地合并文件:

enter image description here

我期望:

enter image description here

我尝试将ignore_index选项指定为True,但未进行任何更改。怎么了?

0 个答案:

没有答案