Python3对比合并Excel表格
程序员文章站
2022-05-04 11:56:14
##安装模块pip install pandas as pdpip install xlsxwriterpip install openpyxl ##带入模块import pandas as pdimport xlsxwriterimport openpyxl df1 = pd.read_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
上一篇: 最长上升子序列
下一篇: 浅谈营销型网站SEO优化的四大禁忌