Appearance
Python简单小功能Coding
About 104 wordsLess than 1 minute
2022-06-02
读取 Excel
from openpyxl import load_workbook
def read_balance_account():
# 读取余额明细
wb = load_workbook('/Users/qiqiang/Downloads/余额明细-2024-09-01至2024-09-30.xlsx.xlsx')
# 获取活动工作表
ws = wb.active
# 从第 2 行开始,拼接部分字段,values_only表示去计算的值,忽略公式
return set(map(lambda row: row[6] + '-' + row[1] + '-' + row[4], ws.iter_rows(min_row=2, values_only=True)))