“Got 1 columns instead of …” error in numpy

后端 未结 8 853
傲寒
傲寒 2021-01-17 13:00

I\'m working on the following code for performing Random Forest Classification on train and test sets;

from sklearn.ensemble import RandomForestClassifier
fr         


        
8条回答
  •  半阙折子戏
    2021-01-17 13:36

    None of the previous answers worked for me so for future googlers here is another one :

    Error was : "Line #88 (got 1435 columns instead of 1)"

    Discovered that my csv file was a utf8 encoded text file with a BOM(a character marking the encoding on the first line of the file. Most text editors will hide this character)

    I simply opened it in notepad in windows,"saved as" again and selected "ANSI" at the bottom of the save box.

    Fixed it for me.

提交回复
热议问题