以上代码的功能是:

  1. 读取./double_data/44个双字.xlsx的第一列前44个数据存到数组data中。
  2. 读取./doubledata/doubleresult_calligraphy.xlsx并进行处理。
  3. 遍历从第2行到最后一行。
  4. 嵌套遍历双数列。
  5. 如果当前单元格的值不在数组data中,则删除第i行第j列和第i行第j+1列单元格。
  6. 重新遍历整个表格。
  7. 将空数据按列向上填补。
  8. 将更改后的表格存入矩阵中并保存在./doubledata/doubleresultcalligraphy2.xlsx中。
import openpyxl读取double_data44个双字xlsx的第一列前44个数据存到数组data中datafile = doubledata44个双字xlsx datawb = openpyxlloadworkbookdatafile readonly=True dataws = datawbactive data = for row in datawsiterrowsminrow=

原文地址: https://www.cveoy.top/t/topic/ddLV 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录