我有2个Excel工作表,一个有63000行,另一个有67000行,其中包含职业,并且他们的可省略性都具有相同的标题,因此我根据标题进行了合并,但是输出显示了44,00,000行,为什么这样,请帮助我在这个问题上谢谢你,
Import pandas as pd
Df = pd.read_excel('c/downloads/knowledge.xlsx')
Df1 = pd.read_excel('c/downloads/Abilities.xlsx')
Df2 = pd .merge(df,df1,on = 'Title')
# Create a list of the files in the order you want to merge
all_df_list = [df, df1]
# Merge all the dataframes in all_df_list. Pandas will automatically append based on similar column names if that is what you meant by "same title".
appended_df = pd.concat(all_df_list)
# export as an excel file
appended_df.to_excel("data.xlsx", index=False)
让我知道是否有帮助。仅当两个文件中的标签相同时,该标签才有效。