PyExcelerate
PyExcelerate copied to clipboard
Replaced Part: /xl/worksheets/sheet1.xml part with XML error. A document must contain exactly one root element. Line 1, column 0.
Here is my code when using PyExcelerate
from pyexcelerate import Workbook
def to_excel(df, path, sheet_name="Documents"):
data = [
df.columns.tolist(),
] + df.values.tolist()
wb = Workbook()
wb.new_sheet(sheet_name, data=data)
wb.save(path)
I can't debug the error because I do not see any value to search. Does anyone know how to fix this?
Do you have a sample dataframe to reproduce the issue?
Do you have a sample dataframe to reproduce the issue?
I do not know :( I do not have idea why this happen. Before this, I have issue with NULL @ !NUM but already solved. Now this issue come out.
Hey @amzar96, you mentioned I have issue with NULL @ !NUM but already solved
. Can you please let me know your solution ? I'm looking for a work around too.
@sgsaikat do you have a dataframe that you can share to reproduce your issue?
@kevmo314 Actually, it's not an issue per se. I simply want to replace all the instances of the NULL values with blanks which gets converted to !NUM. In my case, the df.fillna()
doesn't work, it errs out.
I had the same error, but in my case pyexcelerate worked fine until the file reached 230,000 rows, after that pyexcelerate created the file with no errors in console, but when I tried to open the file Excel showed the error.