I am trying to read excel sheet(xlsx), which is using background color to differentiate values.
I tried following libraries:
- pandas, did not find any option to read background color based cells.
xlrd.
import xlrd xlrd.open_workbook("filename.xlsx", formatting_info=True)
It gives error as: NotImplementedError: formatting_info=True not yet implemented.
StyleFrame (As Suggested by DeepSpace in: Subsetting a dataframe based on cell color and text color in excel sheet )
from StyleFrame import StyleFrame, utils sf = StyleFrame.read_excel('filename.xlsx', read_style=True, use_openpyxl_styles=False)
It gives error as:
Traceback (most recent call last):
File "proj_path/read_excel.py", line 22, in <module>
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
Any suggestion to help me move to correct direction is highly appreciated.