Issue
Im tryin to read csv file with pandas using this flowing code
data = pd.read_csv(CSV_FILE)
But i get this error
File "pandas/_libs/parsers.pyx", line 642, in pandas._libs.parsers.TextReader._get_header
File "pandas/_libs/parsers.pyx", line 843, in pandas._libs.parsers.TextReader._tokenize_rows
File "pandas/_libs/parsers.pyx", line 1917, in pandas._libs.parsers.raise_parser_error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x99 in position 1971: invalid start byte ```
Solution
You forgot add encoding = ''
try this code :
data = pd.read_csv(CSV_FILE, encoding='ISO-8859-1')
Answered By - AissamR38
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.