我想读取一个 xlsx 文件,将所有小于 0.0001 的值更改为 0.01。我可以读取值并打印它们,但我不能更改它们?
import pylab
from openpyxl import load_workbook
wb = load_workbook(filename = 'TF-Automation.xlsx', use_iterators=True)
ws = wb.get_sheet_by_name(name = 'Huvudmatris')
for row in ws.iter_rows():
for cell in row:
if cell.internal_value < 0.00001:
cell.set_value = 0.000001
print cell.internal_value