Python Forum
Problem with importing a CSV file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with importing a CSV file
#4
[Image: view?usp=drivesdk]

I have tried but I still get an error message.
pd.read_csv("G:\\Analyser\\2019 OS\\test.csv", header=None, error_bad_lines=False)
the error message:
pd.read_csv(""G:\\Analyser\\2019 OS\\test.csv"", header=None, error_bad_lines=False)
b'Skipping line 4: expected 1 fields, saw 2\nSkipping line 7: expected 1 fields, saw 2\nSkipping line 44: expected 1 fields, saw 2\nSkipping line 47: expected 1 fields, saw 2\nSkipping line 48: expected 1 fields, saw 2\nSkipping line 62: expected 1 fields, saw 2\nSkipping line 68: expected 1 fields, saw 2\nSkipping line 83: expected 1 fields, saw 2\nSkipping line 98: expected 1 fields, saw 2\nSkipping line 101: expected 1 fields, saw 2\nSkipping line 103: expected 1 fields, saw 2\nSkipping line 181: expected 1 fields, saw 2\nSkipping line 245: expected 1 fields, saw 2\nSkipping line 314: expected 1 fields, saw 2\n'
Traceback (most recent call last):

  File "<ipython-input-1-aef5c76db53b>", line 3, in <module>
    pd.read_csv("G:\\Analyser\\2019 OS\\test.csv", header=None, error_bad_lines=False)

  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 702, in parser_f
    return _read(filepath_or_buffer, kwds)

  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 435, in _read
    data = parser.read(nrows)

  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 1139, in read
    ret = self._engine.read(nrows)

  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 1995, in read
    data = self._reader.read(nrows)

  File "pandas/_libs/parsers.pyx", line 899, in pandas._libs.parsers.TextReader.read

  File "pandas/_libs/parsers.pyx", line 914, in pandas._libs.parsers.TextReader._read_low_memory

  File "pandas/_libs/parsers.pyx", line 991, in pandas._libs.parsers.TextReader._read_rows

  File "pandas/_libs/parsers.pyx", line 1123, in pandas._libs.parsers.TextReader._convert_column_data

  File "pandas/_libs/parsers.pyx", line 1176, in pandas._libs.parsers.TextReader._convert_tokens

  File "pandas/_libs/parsers.pyx", line 1299, in pandas._libs.parsers.TextReader._convert_with_dtype

  File "pandas/_libs/parsers.pyx", line 1315, in pandas._libs.parsers.TextReader._string_convert

  File "pandas/_libs/parsers.pyx", line 1553, in pandas._libs.parsers._string_box_utf8

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe5 in position 95: invalid continuation byte
Reply


Messages In This Thread
Problem with importing a CSV file - by Chopan2211 - Nov-05-2019, 02:19 PM
RE: Problem with importing a CSV file - by buran - Nov-05-2019, 02:23 PM
RE: Problem with importing a CSV file - by Chopan2211 - Nov-05-2019, 04:31 PM
RE: Problem with importing a CSV file - by buran - Nov-05-2019, 04:46 PM
RE: Problem with importing a CSV file - by DeaD_EyE - Nov-06-2019, 09:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  New2Python: Help with Importing/Mapping Image Src to Image Code in File CluelessITguy 0 755 Nov-17-2022, 04:46 PM
Last Post: CluelessITguy
  Problem with importing python-telegram library into the project gandonio 1 1,636 Nov-01-2022, 02:19 AM
Last Post: deanhystad
  Problem with importing Python file in Visual Studio Code DXav 7 5,314 Jun-15-2022, 12:54 PM
Last Post: snippsat
  importing functions from a separate python file in a separate directory Scordomaniac 3 1,428 May-17-2022, 07:49 AM
Last Post: Pedroski55
  Importing a function from another file runs the old lines also dedesssse 6 2,661 Jul-06-2021, 07:04 PM
Last Post: deanhystad
  Importing text file into excel spreadsheet with formatting david_dsmn 1 3,681 Apr-05-2021, 10:21 PM
Last Post: david_dsmn
  importing a CSV file into Python russoj5 1 2,992 Aug-02-2020, 12:03 AM
Last Post: scidam
  Importing data from a text file into an SQLite database with Python macieju1974 7 4,256 Jun-29-2020, 08:51 PM
Last Post: buran
  importing CSV file into a OOP Class table using Python faruk61 1 3,014 Apr-15-2020, 12:00 PM
Last Post: faruk61
  importing CSV file into a HTML table using Python trybakov 1 2,336 Feb-22-2020, 09:47 PM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020