Hi everyone!
I have an issue with loading a cvs file on my jupiter notebook.
I just upgrader it from version 6 to V7 and trying to read the file an error occured.
Please how do i fix, unicodeDecodeError: ‘utf-8’ code can’t decode byte 0x89 in position 10: invalid start byte
I doubt it was that alone that is causing this. There was probably some other update, too.
It usually means you have to specify the encoding when trying to read it, like here or here or here or here. And maybe if you are already doing that, it isn’t quite the correct encoding? However, you provide no code or data to help us really know what is going on or help you with practical advice?
Anyway, can you provide a toy example will at least the 10th position of some sort large intact since that is the root cause, it seems?
And this is probably not a Jupyter issue. Did you try running the same code in a Python interpreter/console or as a traditional Python script? I suspect if you ran it in the same environment you’d have the same issue regardless of if Jupyter is involved or not.
My special thanks to you sir, i appreciate your effort .
earlier on i tried it on pycharm IDE same error code, i have use ‘utf-16’ and ‘ISO-8859-1’ it did not work, i did a little findings, it was the csv that had 5 rows #comments of instructions, so i skipped the rows with comments.
Thanks again sir.
Pandas .read_csv()
has a skiprows
setting you can include and provide details in order to skip things like that. See skiprows
in pandas.read_csv
documentation.