Rows are lost when reading this tab-separated file with pandas read_csv

前端 未结 1 695
盖世英雄少女心
盖世英雄少女心 2021-02-06 08:47

I have a .text file with following format, where fields (index number, name and message) are separated by \\t (tab-separated):

712 ben          


        
1条回答
  •  旧巷少年郎
    2021-02-06 09:22

    I think you need add parameter quoting:

    import csv
    
    chat = pd.read_csv("f.text",sep = "\t", header = None, usecols = [2], quoting=csv.QUOTE_NONE)
    

    0 讨论(0)
提交回复
热议问题