One of the cells' value in a dataframe is a very long string. When pandas writes it to an excel sheet, that value is getting truncated. Any reason why? Below is my code snippet.
excel_path = './{}_somename.xlsx'.format(name)
options = {'strings_to_formulas': False, 'strings_to_urls': False}
writer = pd.ExcelWriter(excel_path, engine='openpyxl', options=options)
for df_name, df in df_dict.items():
df.to_excel(writer, sheet_name=str(df_name), startrow=0, index=False)
writer.save()
example of the very long string inside the cell: "asdasdas® aadsdas Psgdfgjj (4 hgjhj, 4r A77 @1.20 erer)|Ahjdks A7373X Hkjnksds (9 Djhks @ 1.50YUx)"
. Actual string could be 10,000,000 chars long.
Note: For confidentiality reasons, I cannot share the exact string.
CodePudding user response:
Openpxyl writes Excel 2007 (.xlsx
) files and these files have a 32,767 character limit per cell.
10,000,000 characters will therefore never work.