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')

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章