我有一个包含大量文本数据的txt文件,sep = " "
无法正常工作,因为第二列都是字符串。
数据结构:
sentence_index sentence
1 The Rock is destined to be the 21st Century 's new `` Conan '' and that he 's going to make a splash even greater than Arnold Schwarzenegger , Jean-Claud Van Damme or Steven Segal .
2 The gorgeously elaborate continuation of `` The Lord of the Rings '' trilogy is so huge that a column of words can not adequately describe co-writer\/director Peter Jackson 's expanded vision of J.R.R. Tolkien 's Middle-earth .
3 Effective but too-tepid biopic
我使用的代码:
sentences = pd.read_csv("filename.txt", sep=" ",error_bad_lines=False)