2

I want to open and read an excel file with pd.read_excel using utf-8 (so other languages could be read) as in read_csv the encodings can be set to utf-8, is it possible somehow?

Bar Kadosh
  • 31
  • 1
  • 3
  • Does this answer your question? [Pandas read \_excel: 'utf-8' codec can't decode byte 0xa8 in position 14: invalid start byte](https://stackoverflow.com/questions/48647122/pandas-read-excel-utf-8-codec-cant-decode-byte-0xa8-in-position-14-invalid) – Sanjay SS Oct 14 '21 at 18:08

1 Answers1

0

You may pass an open file:

with open("file_path", encoding="utf-8") as f:
    pd.read_excel(f)

I didn't find a reference in the docs but a quick look in pandas code suggests "utf-8" might be the default already.

Jérôme
  • 13,328
  • 7
  • 56
  • 106
  • Thank you! it seems I have a problem when trying to use the values (from the excel file) for text in kivy labels for example, so the codec does work, how can I fix it? – Bar Kadosh Oct 14 '21 at 18:10