StyleFrame is a Python library that wraps pandas and openpyxl and makes outputting styled dataframes to Excel easy.
Questions tagged [styleframe]
53 questions
0
votes
1 answer
How to read colored object in excel using python and apply formula?
I have an excel file like as shown below. File can be downloaded from the link here
each color has a score. ex: red color = 0, green color = 90 and Tacao = 50
So, for each row, I would like to compute the average score and store it in a new…

The Great
- 7,215
- 7
- 40
- 128
0
votes
0 answers
Adding a frame border to a dataframe in Excel
It seems simplistic as a task to perform, but I've been having hard time to add a border frame to my excel-written table (using xlsxwriter engine). The only way I could do so is by getting the size of my df & starting row/column then loop on each…

Keyser Soze
- 262
- 3
- 11
0
votes
1 answer
How to apply Styleframe to an excel file that has two sheets
I have an excel file that hVave two sheets. I want to open the excel and apply Style frame to two sheets.
Usually when the excel have only one sheet I use this code:
sf=StyleFrame.read_excel("test.xlsx",…

user14073111
- 647
- 5
- 14
0
votes
1 answer
color specific cells in excel python
i have 2 dataframes, from which i have to identify a difference in cells. Wherever i will find a difference, i have to change color of that cell(background color) in first dataframe aswell as in second dataframe.
In my case first dataframe cell has…

ras
- 41
- 1
- 10
0
votes
1 answer
How to color only sepcific headers in a dataframe and save it to excel
Let say I have dataframe like this:
col1 sub col 2 col3 col4
0 A A_1 pass 2
1 A A_2 pass 4
2 A A_1 fail 4
3 A A_1 fail 5
4 A…

user14073111
- 647
- 5
- 14
0
votes
1 answer
StyleFrame row_index AttributeError: 'int' object has no attribute 'value'
I'm attempting to programmatically create a spreadsheet to store some AWS data, by taking an Excel template and adding new data to it. I decided to use StyleFrame for this to preserve the formatting. I've managed to get the data concatenated…

Salivanth
- 3
- 1
0
votes
1 answer
How to apply Style Frame on individual cells using apply_style_by_indexes()
is there a way to apply StyleFrame on individual cells rather than using some conditional statements to style the entire row.

prathik vijaykumar
- 355
- 3
- 12
0
votes
0 answers
How to avoid ValueError when calling StyleFrame.apply_style_by_indexes?
Currently I'm having a big list of StyleFrame objects. Some of the cells from some dataframes i want to color the background based on their value: > 1 in red and <=1 in green. I think that multiple calls of "apply_style_by_indexes" method creates…
0
votes
1 answer
'numpy.ndarray' object has no attribute 'value'
My working code has suddenly stopped working today because of this error. Can someone please help me in solving this?
style = Styler(bg_color = 'red',font_size=10)
sf = StyleFrame(filtered_data)
#Getting Error at following…

HobbyCoder
- 45
- 9
0
votes
1 answer
Excel Workbook must be reopened to see updates from DataFrame / StyleFrame
I am writing a StyleFrame to a new Excel sheet, but I cannot see the changes until I reopen the Workbook. How can I see the update immediately? I tried using a DataFrame as well but with the same result.
writer =…

Rezzy777
- 45
- 6
0
votes
1 answer
StyleFrame (or styleframe?) import issue
This is not a deal breaker but I used to import this library via "import StyleFrame", but now it throws the error:
ModuleNotFoundError: No module named 'StyleFrame'
Switching from "import StyleFrame" to "import styleframe" fixes the problem, but…

viks_python
- 77
- 1
- 6
0
votes
0 answers
Combine same text color excel cells into one using python?
I'm looking for a solution to combine same text color excel cells into a single cell in a column. The following image shows the input_excel.xlsx :-
Input image to python code
The output_excel.xlsx should be returned by python code as…

The Programmer
- 23
- 10
0
votes
0 answers
color text using StyleFrame in python
I want to have a yellow background in some certain rows and in those rows I want some text to be red. Here is an example :
So far I am able to achieve yellow background in some certain rows using :
from StyleFrame import StyleFrame, Styler
…

Anudocs
- 686
- 1
- 13
- 54
0
votes
1 answer
How to update StyleFrame values?
I have made a StyleFrame from some excel data. I want to update this StyleFrame values (for eg. I want to change the value in the cell corresponding to A1 to 5).
For eg, I have the following code where sf is the styleframe object:
sf[0] = 5
This…

user12790885
- 1
- 1
0
votes
1 answer
Is there a function to unhide columns in excel through python
I have an Excel spreadsheet which is converted to a DataFrame using StyleFrame to keep color formatting. When I convert this DataFrame back to an Excel spreadsheet, a few columns are already hidden by default. This is my code:
import openpyxl
import…

user12790885
- 1
- 1