import pandas
sheet = pandas.read_excel("test.xlsx", "Sheet1")
for row in sheet.index.values:
doc = dict()
doc['key1'] = sheet.iloc[row, 0]
print(doc['key1'])
sheet.loc[row,1] = doc['key1']
sheet.to_excel("output.xlsx", sheet_name="Sheet1", index=False)
python循环读取写入Excel
于 2024-03-11 14:37:33 首次发布