I had the same error when I tried to open a CSV file by pandas.read_csv
method.
The solution was change the encoding to latin-1
:
pd.read_csv('ml-100k/u.item', sep='|', names=m_cols , encoding='latin-1')
More Related Contents:
- UnicodeDecodeError: ‘charmap’ codec can’t decode byte X in position Y: character maps to
- What exactly do “u” and “r” string flags do, and what are raw string literals?
- What does the ‘b’ character do in front of a string literal?
- How to remove \xa0 from string in Python?
- How to get string objects instead of Unicode from JSON?
- Why does Python print unicode characters when the default encoding is ASCII?
- How do you decode Base64 data in Python?
- text with unicode escape sequences to unicode in python [duplicate]
- Python str vs unicode types
- Non-ASCII characters in Matplotlib
- How do I check if a string is unicode or ascii?
- Removing u in list
- Conversion of strings like \\uXXXX in python
- Python 3 print() function with Farsi/Arabic characters [duplicate]
- Python – Unicode to ASCII conversion
- Python DictWriter writing UTF-8 encoded CSV files
- UnicodeDecodeError: ‘utf8’ codec can’t decode bytes in position 3-6: invalid data
- What does ‘u’ mean in a list?
- Saving UTF-8 texts with json.dumps as UTF-8, not as a \u escape sequence
- How is unicode represented internally in Python?
- Unicode identifiers in Python?
- Printing a string prints ‘u’ before the string in Python?
- How does unicodedata.normalize(form, unistr) work?
- Python – dealing with mixed-encoding files
- Python the same char not equals
- Unicode encoding for filesystem in Mac OS X not correct in Python?
- Chinese unicode fonts in PyGame
- Printing Unicode in eclipse Pydev console and in Idle
- UnicodeDecodeError when reading CSV file in Pandas
- Bytes in a unicode Python string