python pandas 报错:TypeError: parser_f() got an unexpected keyword argument 'skip_blank_lines'
在用pandas读取csv数据进行处理时,报了个错:
pd.read_csv(train_path, delimiter='\t', quoting=csv.QUOTE_NONE, skip_blank_lines=True, header=None, names=["char", "label"])
TypeError: parser_f() got an unexpected keyword argument 'skip_blank_lines'
经过一顿stackoverflow 知道了,原来是pandas的版本没跟上来,
As the docs for 0.13.1's read_table show, there is no skip_blank_lines
argument.
That wasn't introduced until 0.15.0:
pandas版本是0.14,但是只有0.15以上的版本的read_csv才有skip_blank_lines参数。
更新之:
sudo pip install -U pandas==0.17.1