import openpyxl读取double_data44个双字xlsx的第一列前44个数据存到数组data中datafile = doubledata44个双字xlsx datawb = openpyxlloadworkbookdatafile readonly=True dataws = datawbactive data = for row in datawsiterrowsminrow=
以上代码的功能是:
- 读取./double_data/44个双字.xlsx的第一列前44个数据存到数组data中。
- 读取./doubledata/doubleresult_calligraphy.xlsx并进行处理。
- 遍历从第2行到最后一行。
- 嵌套遍历双数列。
- 如果当前单元格的值不在数组data中,则删除第i行第j列和第i行第j+1列单元格。
- 重新遍历整个表格。
- 将空数据按列向上填补。
- 将更改后的表格存入矩阵中并保存在./doubledata/doubleresultcalligraphy2.xlsx中。
原文地址: https://www.cveoy.top/t/topic/ddLV 著作权归作者所有。请勿转载和采集!