python pandas 报错:TypeError: parser_f() got an unexpected keyword argument 'skip_blank_lines'

版权声明:本文为博主原创文章,转载请注明转自 Scofield's blog[http://blog.csdn.net/scotfield_msn] https://blog.csdn.net/Scotfield_msn/article/details/60338515

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

Ok done`

猜你喜欢

转载自blog.csdn.net/Scotfield_msn/article/details/60338515
今日推荐