How to freeze the top row and the first column using XlsxWriter?
Clash Royale CLAN TAG#URR8PPP
How to freeze the top row and the first column using XlsxWriter?
I am exporting a pandas DataFrame
to Excel, and since it contains a lot of rows and columns, it would be useful to keep the top row and the first column when browsing its contents.
DataFrame
There is a feature present in Excel that allows for freezing the top row and the first column. Is accessible through XlsxWriter
when exporting DataFrames to excel?
XlsxWriter
1 Answer
1
You can use worksheet.freeze_panes()
to achieve this . There are many options for that method. Read http://xlsxwriter.readthedocs.io/worksheet.html#worksheet-freeze-panes to know how to use the method.
worksheet.freeze_panes()
worksheet.freeze_panes(1, 1)
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Thanks! I tried the suggested
worksheet.freeze_panes(1, 1)
and it worked.– Krzysztof Słowiński
Jan 30 at 11:02