import pandas as pd

data1 = pd.read_excel(r"C:\Users\asus\Desktop\附件1.xlsx") print(data1)

data2 = pd.read_excel(r'C:\Users\asus\Desktop\附件2.xlsx') print(data2)

all_data = pd.merge(data1, data2, on='单品编码', how='left') print(all_data)

all_data.to_excel(r"D:\spyder文件\数学建模.xlsx")

帮我改一下这段代码data1=pdread_excelrCUsersasusDesktop附件1xlsxprintdata1data2=pdread_excelrCUsersasusDesktop附件2xlsxprintdata2all_data=pdmergedata1data2left_on=单品编码right_on=单品编码how=leftprintall_dataall_datato_ex

原文地址: https://www.cveoy.top/t/topic/i2eC 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录