how do i fix this error message??? #1697
Replies: 1 comment
-
This error often arises when you're trying to read a file that isn't encoded in UTF-8, which is pandas' default assumption. The error suggests that the file might have a different encoding or isn't a plain text CSV file but rather a binary format like a compressed file. Here are steps to address it:
If you're still facing issues, let me know what you're observing, and we can troubleshoot further together! |
Beta Was this translation helpful? Give feedback.
-
UnicodeDecodeError Traceback (most recent call last)
in <cell line: 0>()
----> 1 df = pd.read_csv('/content/cleaned_test_booking_data.csv')
4 frames
/usr/local/lib/python3.11/dist-packages/pandas/io/parsers/c_parser_wrapper.py in init(self, src, **kwds)
91 # Fail here loudly instead of in cython after reading
92 import_optional_dependency("pyarrow")
---> 93 self._reader = parsers.TextReader(src, **kwds)
94
95 self.unnamed_cols = self._reader.unnamed_cols
parsers.pyx in pandas._libs.parsers.TextReader.cinit()
parsers.pyx in pandas._libs.parsers.TextReader._get_header()
parsers.pyx in pandas._libs.parsers.TextReader._tokenize_rows()
parsers.pyx in pandas._libs.parsers.TextReader._check_tokenize_status()
parsers.pyx in pandas._libs.parsers.raise_parser_error()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
Beta Was this translation helpful? Give feedback.
All reactions