c-rob
(Chuck R.)
April 8, 2024, 1:16pm
1
Python 3.12 on Windows 10 Pro. I’m still relatively new to Python.
Looking for reference for Pandas xlsxwriter values to use in formatting an Excel cell. I’ve done some searching but have not found it yet.
I looked in the docs under
ExcelWriter.book
but the page is blank for Pandas 2.2 even though there should be a function called .add_format()
.
I’ve looked at the API guide and User Guide and both seem suboptimal for a new user.
Reading at least 3 pages for a Google Search revealed nothing.
c-rob
(Chuck R.)
April 8, 2024, 4:33pm
3
No. I do not want to format whole columns, the header row will contain numbers it will contain strings. I want to format individual cells based on their value. This is the type of formatting reference I’m looking for.
workbook = writer.book
worksheet = writer.sheets['Sheet1']
# Add a header format.
boldfmt = workbook.add_format({'bold': True,'text_wrap': True,
'valign': 'bottom', 'fg_color': 'black',
'bg_color': 'white', 'border': 1})
I’m looking for the keywords used in .add_format(). For example if the number in col C is > 25 I want to make the background light orange.