_csv.Error: field larger than field limit (131072)

后端 未结 8 1983
有刺的猬
有刺的猬 2020-11-28 19:10

I have a script reading in a csv file with very huge fields:

# example from http://docs.python.org/3.3/library/csv.html?highlight=csv%20dictreader#examples
i         


        
8条回答
  •  借酒劲吻你
    2020-11-28 19:46

    You can use read_csv from pandas to skip these lines.

    import pandas as pd
    
    data_df = pd.read_csv('data.csv', error_bad_lines=False)
    

提交回复
热议问题