我有一个
.text
文件格式如下,其中字段(索引号、名称和消息)由
\t
(制表符分隔):
712 ben Battle of the Books
713 james i used to be in TOM
714 tomy i was in BOB once
715 ben Tournaments of Minds
716 tommy Also the Lion in the upcoming school play
717 tommy Can you guess
718 tommy P
...
我用它读
read_csv
转换成数据帧:
chat = pd.read_csv("f.text", sep = "\t", header = None, usecols = [2])
但数据帧只有
9812
行,而普通文件的行数超过
12428
行(只有21个空行)。这很奇怪。你有什么想法吗?谢谢