I have a large excel file with 90k rows, and I want to add only the rows that have red colored text to a dataframe (using styleframe). The code below works if I use a small excel file with 5 rows, but when I attempt to use it with a larger file the data frame is always empty.
even if I remove the dropna I get a styleframe with all Nans, and no reds.
sf = StyleFrame.read_excel('myFile.xlsx', read_style=True, use_openpyxl_styles=False, usecols = ['COLUMN_1'], header = 2)
.
def only_cells_with_red_text(cell):
return cell if cell.style.font_color in {utils.colors.red, 'FFFF0000'} else np.nan
.
sf_2 = StyleFrame(sf.applymap(only_cells_with_red_text).dropna(axis=(0, 1), how='all'))
I expected only cells with red text to be added to dataframe
The output is Empty DataFrame
Columns: []
Index: []