实现的功能是合并两个excel表格的内容,以某一列为唯一索引
# -*- coding: UTF-8 -*-
import time
import os
import xlwings as xw
################################################################################
def excelMapGet(excel, sheet, key):
start = time.time()
table = xw.Book(excel)
table_sht = table.sheets[sheet]
row_max = table_sht.used_range.last_cell.row
column_max = table_sht.used_range.last_cell.column
# print(row_max)
# print(column_max)
# print(table_sht[0:row_max,0:column_max].value)
title_list = table_sht[0, 0:column_max].value
title_map = {}
for i in range(len(title_list)):
title_map[title_list[i]] = i
# print(title_list)
# print(title_map)
excel_table = table_sht[0:row_max,0:column_max].value
# print(excel_table)
excel_key = 0
excel_map = {}
for i in range(1, row_max):
e