Python3对比合并Excel表格

##安装模块
pip install pandas as pd
pip install xlsxwriter
pip install openpyxl

##带入模块
import pandas as pd
import xlsxwriter
import openpyxl

df1 = pd.read_excel('4.xlsx')
df2 = pd.read_excel('4_6F_工位网络面板.xlsx',sheet_name='60-old')
df3=pd.merge(df1,df2,how='left',on='net_int') #按照关键列net_int合并
print(type(df3))
df3.to_excel('88.xlsx',sheet_name='88') #输出excel

posted @ 2020-03-16 14:11  小木目心  阅读(492)  评论(0编辑  收藏  举报