'python' engine because the 'c' engine does not support regex separators

2018-10-2 杜世伟 Python

moveielens.py:17: ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\s+' are interpreted as regex); you can avoid this warning by specifying engine='python'.
  user = pd.read_table(path1, sep='::', header=None, names=unames)

  pandas.read_table()函数,读取文件数据时,由于分隔符为'::',弹出如下警告
       警告:ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\s+' are interpreted as regex)
       解决方法:增加函数的引擎参数engine='python',如下:

    user = pd.read_table(path1, sep='::', header=None, names=unames, engine='python')

阅读全文>>

标签: python pandas re read_table

评论(0) 浏览(3971)

Powered by emlog 沪ICP备2023034538号-1