Im testing how pandas works saving excel files and came along and error when i tried making it read and save a big excel file.
So i tried it with a small sample from my big excel file to test, around 150 rows, and it works. So i used the full sheet, around 200,000 rows, and got a couple errors
This is what Im using to test saving
import pandas as pd
xls = pd.ExcelFile('File\\Path\\File.xlsx')
df = pd.read_excel(xls, 'Sheet_Name')
df.to_excel('TEST.xlsx')
This is all the code so Im wondering why Im getting errors.
This is what the console reports
File "C:/Users/CSR001/PycharmProjects/CLeaner/Base.py", line 30, in <module>
df.to_excel('TEST.xlsx')
File "C:\Users\CSR001\PycharmProjects\CLeaner\venv\lib\site-packages\pandas\core\generic.py", line 2257, in to_excel
engine=engine,
File "C:\Users\CSR001\PycharmProjects\CLeaner\venv\lib\site-packages\pandas\io\formats\excel.py", line 739, in write
freeze_panes=freeze_panes,
File "C:\Users\CSR001\PycharmProjects\CLeaner\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 416, in write_cells
xcell.value, fmt = self._value_with_fmt(cell.val)
File "C:\Users\CSR001\PycharmProjects\CLeaner\venv\lib\site-packages\openpyxl\cell\cell.py", line 252, in value
self._bind_value(value)
File "C:\Users\CSR001\PycharmProjects\CLeaner\venv\lib\site-packages\openpyxl\cell\cell.py", line 205, in _bind_value
value = self.check_string(value)
File "C:\Users\CSR001\PycharmProjects\CLeaner\venv\lib\site-packages\openpyxl\cell\cell.py", line 169, in check_string
raise IllegalCharacterError
openpyxl.utils.exceptions.IllegalCharacterError
Note: The main excel file has some symbols characters in the cells so it could be that causing the errors.
There are cell that have data like this
Ex.
____
Ãznur
-
Håkon
Are these affecting how pandas can save?