900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > python 读excel中的sheet_Python使用一些背景颜色读取Excel工作表(xlsx)中的单元格?...

python 读excel中的sheet_Python使用一些背景颜色读取Excel工作表(xlsx)中的单元格?...

时间:2023-08-14 10:01:56

相关推荐

python 读excel中的sheet_Python使用一些背景颜色读取Excel工作表(xlsx)中的单元格?...

我正在尝试阅读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 ment)

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

我们非常感谢任何帮助我改变方向的建议。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。