問題解決前的代碼:
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')