Traceback (most recent call last): File "V:/PyLib/数据分析/excel数据整理/测试1/step1:简单合并.py", line 23, in <module> new_workbook[sheet_name].append(r) File "C:\Python3.8.5\lib\site-packages\openpyxl\worksheet\worksheet.py", line 676, in append self._invalid_row(iterable) File "C:\Python3.8.5\lib\site-packages\openpyxl\worksheet\worksheet.py", line 812, in _invalid_row raise TypeError('Value must be a list, tuple, range or generator, or a dict. Supplied value is {0}'.format( TypeError: Value must be a list, tuple, range or generator, or a dict. Supplied value is <class 'numpy.ndarray'>
时间: 2023-05-15 09:07:04 浏览: 175
这个错误是因为在使用 openpyxl 库时,传入的值必须是列表、元组、范围或生成器,或者是字典,而你传入的是 numpy 数组,所以出现了类型错误。你需要将 numpy 数组转换为列表或元组,然后再传入 openpyxl 库中的函数。
阅读全文