pandas.read_csv()函数弹出警告

 问题解决前的代码:

stoplist = pd.read_csv("stopwords.txt", encoding='utf-8', header=None, sep='tipdm')

执行程序读取文件数据时,报错如下(自我感觉虽然报错,但不影响程序的正常运行

警告: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'.
  stoplist = pd.read_csv("stopwords.txt", encoding='utf-8', header=None, sep='tipdm')

 

解决方法:

增加函数的引擎参数engine='python',如下:

stoplist = pd.read_csv("stopwords.txt", encoding='utf-8', header=None, sep='tipdm', engine='python')

 

你可能感兴趣的:(漫漫Python路)