Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on November 10, 2021 7:38PM
Likes: 0
Replies: 5
I would like my output excel file to have colors. But I need help with my python code that will color the cells. Something like:
If "Strong", then color the cells Green
If "Satisfactory", then color the cells Yellow
Then I need to connect the If statement to the Pattern Fill code:
Fill_Pattern = PatternFill(patterntype='solid', fgcolor='00B050')
ws[insert appropriate columns].fill = fill_pattern
I've not done this before.
However, this might be interesting.
https://www.youtube.com/watch?v=ZXjHAxHyi9k
In Dataiku DSS we can of course use Jupyter Notebooks.
The interesting part here is the use of the engine openpyxl when Saving to move Pandas Dataframe formating into the resulting MS Excel file.
https://openpyxl.readthedocs.io/en/stable/formatting.html
Let us know how you get on with this.
Sounds like an interesting challenge. It will likely be strongly dependent on the Python library you are choosing to work with. What Python library are you using/ importing that has those capabilities?
Thank you will do!