Closed karolszk closed 2 years ago
Hi, thanks for your request. Please always provide copy and pasteable examples.
Just a note: All attributes of ExcelWriter are considered private
Right @phofl . Below the copy&pastable example:
import pandas as pd
df=pd.DataFrame({"a":[1,2,3],"b":[1,2,3]})
writer=pd.ExcelWriter("test.ods") # .xlsx works fine
df.to_excel(writer, sheet_name='my_analysis')
writer.sheets['my_analysis'].set_column(0,0,40)
So first: The ExcelWriter attributes are private (sheets here), so we can not make any guarantees.
Second: writer.sheets[elem] is an odf.elem.Element
in case of ods files, this is nothing we have control over. You should contact this project with your request. In case of xlsx files, we get a xlsxwriter.worksheet.Worksheet
object, which seems to support this.
Hello,
Please, add possibility to setting column width: set_column support in ExcelWriter class for ODF open standard documents. Currently pandas doesn't support it. Pandas supports (and working fine) set_column for XLSX Excel files. Similar functionality will be useful for all which strongly supports open standards.
Below example explains the issue:
Thank you.