我正在尝试阅读excel表(xlsx),它使用背景颜色来区分值。
我尝试了以下库:大熊猫,没有找到任何选择阅读基于背景颜色的细胞。
xlrd。
import xlrd xlrd.open_workbook("filename.xlsx", formatting_info=True)
它给出错误:NotImplementedError:formatting_info = True尚未实现。StyleFrame(由DeepSpace建议:在excel表格中根据单元格颜色和文本颜色子集数据框)
from StyleFrame import StyleFrame, utils sf = StyleFrame.read_excel('filename.xlsx', read_style=True, use_openpyxl_styles=False)
它给出了错误:Traceback (most recent call last):
File "proj_path/read_excel.py", line 22, in
sf = StyleFrame.read_excel('filename.xlsx', read_style=True, use_openpyxl_styles=False)
File "C:\Anaconda\lib\site-packages\StyleFrame\deprecations.py", line 22, in inner
return func(*args, **kwargs)
File "C:\Anaconda\lib\site-packages\StyleFrame\style_frame.py", line 220, in read_excel
_read_style()
File "C:\Anaconda\lib\site-packages\StyleFrame\style_frame.py", line 209, in _read_style
read_comments and current_cell.comment)
File "C:\Anaconda\lib\site-packages\StyleFrame\styler.py", line 127, in from_openpyxl_style
font_color = theme_colors[openpyxl_style.font.color.theme]
TypeError: list indices must be integers or slices, not Integer
我们非常感谢任何帮助我改变方向的建议。