0

我有一个 csv 包含大约 600K 观察值,我正在使用 fread 导入它

DT = dt.fread('C:\\Users\\myamulla\\Desktop\\proyectos_de_py\\7726_analysis\\datasets\\7726export_Jan_23.csv')

它抛出一个错误 -


--------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-3-01684fbecd91> in <module>
----> 1 dt.fread('C:\\Users\\myamulla\\Desktop\\proyectos_de_py\\7726_analysis\\datasets\\7726export_Jan_23.csv')

IOError: Too few fields on line 432815: expected 14 but found only 4 (with sep=','). Set fill=True to ignore this error.  <<19731764,2021-01-23 23:30:15,2021-01-23 23:42:20,"Vote for David Borrero, your Republican in HD 105. Potestad betrayed Prez Trump. Borrero is for our values & POTUS Trump.>>

正如这里所建议的,我在 fread 语句中传递了参数 fill=True 。

DT = dt.fread('C:\\Users\\myamulla\\Desktop\\proyectos_de_py\\7726_analysis\\datasets\\7726export_Jan_23.csv',fill=True)

它执行,但 DT 将被创建为 EMPTY。

如何解决?

4

0 回答 0