'Pandas read_csv UnicodeDecodeError: invalid start byte
I am trying to read a .csv file using pandas but get this error.
Line of code:
pd.read_csv(r"C:\Users\antba\Desktop\ffstats.csv")
Error message:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 85: invalid start byte
I've removed the 'r' from the pd.read_csv command but was met with a different error message. Any help would be appreciated, thank you.
Solution 1:[1]
Okay, this might be due to encoding. Second Please try google before asking questions on StackOverflow it will help to learn more things.
The reason for your problem is encoding if you know the encoding of CSV try something like this.
pd.read_csv('your_file.csv', encoding = 'ISO-8859-1')
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nitesh Yadav |
