Wrong number of values when importing csv in Weka

前端 未结 9 1227
灰色年华
灰色年华 2021-01-05 15:13

I want to open a csv file (saved from openoffice calc) in weka.

I keep getting an error: \"wrong number of values. 140 read, 139 expected on line 3.\"

The c

相关标签:
9条回答
  • 2021-01-05 15:36

    I had the same error.!!!! I found the solution.

    Just remove all the double-quote, single-quote from the .csv, .xls file.

    i,e for eg. under the Name column if the value is "john" it throws an error. Make it to john by removing the quotes.

    To remove all the quotes, go to the excel file FInd and replace box.

    Find what - "

    Replace with - (empty space)

    0 讨论(0)
  • 2021-01-05 15:38

    If you have copied data from another file using Conrol+A, Control+C and control+V, you copied extra columns. if you open csv file in Nodepad you will see comma in the end of each row. you got this error because of the comma in the end of each row.

    To avoid this error, press Control and select columns one by one then Control+C now copy it to new File which you will use in weka. or you can use another method to avoid comma in the end of each row.

    0 讨论(0)
  • 2021-01-05 15:42

    I had the same error. Problem was a sigle quote character in a string value. Solution for me was to eclose the whole string value in double quotes.

    So I have to convert

                  this: ...,Uncharted 3: Drake's Deception,...
    
               to this: ...,"Uncharted 3: Drake's Deception",...
    

    using weka v. 3.8.0

    0 讨论(0)
  • 2021-01-05 15:46

    I had the same error before. I changed my .xls files without any blank ranks. Sometimes the Weka loaded too many "," . But if I clear the blank ranks than the Weka could be work.

    0 讨论(0)
  • 2021-01-05 15:47

    I also encountered with that error. My csv file contains floating numbers. I have solved that problem by replacing "," with "." .

    0 讨论(0)
  • 2021-01-05 15:51

    I also went through the same problem when I was using Weka and importing a csv file.

    The problem is with the wrong formatting of the file

    In my file there was a word in one of the columns GOV'T what I just did was removed the "'" and wrote a whole word GOVERNMENT and it worked.

    Hope this helps !!

    0 讨论(0)
提交回复
热议问题