[英]Merge the data with the help of python or tableau
我有 2 张 Excel 表,一张有 63000 行,另一张有 67000 行,其中包含职业,它们的 elgibility 都有相同的标题,所以我根据标题合并,但 output 向我展示了 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)
让我知道这是否有帮助。 仅当您在两个文件中具有相同标签时才有效。
确保您使用的是正确的联接类型。 左、右、内、外等。听起来你需要使用左连接。 这会将右侧表中的数据与左侧表中的数据匹配,并相应地返回值,类似于 VLOOKUP。 如果默认联接类型是外部联接,那么它将包括两个表中的所有值,并会显着增加您的记录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.