When reading a CSV file using pd.read_csv(), the following error occurs:
UnicodeDecodeError: ‘UTF-8’ codec can’t decode byte 0xD0 in position 0: invalid continuation byte
The file is not encoded in UTF8, and the system uses UTF8 decoding by default. The solution is to change the corresponding decoding mode.
Solutions:
- find the CSV file – “right after the notepad to open the notepad -” open way “, choose the head menu “file -> save as”, can see the default encoding of the file format for ANSI select encoding a drop-down box, choose the required encoding UTF8, re-save can finally to run the code, the problem is resolved ol>
Read More:
- Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0xd3 in position 238: invalid continuation B
- Successfully resolved Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0xd3 in position 238: invalid continuation B
- Solution of Unicode decodeerror -‘utf-8 ‘codec can’t decode byte 0xc4 in position 0 – invalid continuation byte
- Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0x80 in position 3131: invalid start byte solution
- UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd6 in position 3089: invalid continuation byte
- UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xc3 in position 54: invalid continuation byte
- Solve the ‘UTF-8’ codec can’t decode byte 0xe9 in position 3114: invalid continuation byte error
- Run Python file for the first time with eclipse / pydev: “UTF-8 ‘codec can’t decode byte 0xc4 in position
- python SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: trunca
- Python SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3:
- ‘ascii‘ codec can‘t decode byte 0x90 in position 614: ordinal not in range(128)
- Syntax Error: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position resolution
- How to solve the problem of syntax error: (Unicode error)’unicodescape ‘codec can’t decode bytes in position 2-3: truncat
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- No code, a solution to the error in the path of reading CSV file by Python: filenotfounderror: [errno 2] no such file or directory: ‘XX. CSV‘
- python reads csv file is an error _csv.Error: iterator should return strings, not bytes (did you open the file in text)
- Error reported in Python reading file oserror: [errno 22] invalid argument: ‘u202ac: \ \ users \ \ yyqhk \ \ desktop \ \ 1. CSV’
- Pandas read the CSV file error filenotf oundError:File b ‘***.csv’ does not exist
- Cause: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 26; Byte 1 of 1-byte UTF-8 sequence is invalid.