I have been trying to open an excel file (xlsx format and csv format) using python pandas and I am facing utf-8 encoding errors. I have also tried the encoding codes but could not solve the issue.
Kindly support me to understand and solve the issue
this is the code :
import pandas as pd
excel_file = 'Task1/Data_task1.xlsx'
data = pd.read_excel(excel_file, encoding='utf-8', errors = 'ignore')
print(data)
Error :
File "c:\Users\nivas\Desktop\Srinivas\Internship\Dealroomo\Task1\task1.py", line 4, in <module>
print(data)
File "C:\Users\nivas\Anaconda3\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 3140-3145: character maps to <undefined>