使用datatable读取大尺寸csv文件的错误消息



我有以下代码脚本来打开csv file:

import datatable as dt
file_path=os.path.join(root_path, "train.csv")
print('file_path is ',file_path)
dt.fread(file_path)

运行此代码时,会出现以下错误

file_path is  D:.kaggledatajanestreettrain.csv
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-29-1c38daf7b1ed> in <module>
2 file_path=os.path.join(root_path, "train.csv")
3 print('file_path is ',file_path)
----> 4 dt.fread(file_path)

IOError: Unable to obtain size of D:.kaggledatajanestreettrain.csv: [errno 132] value too large

我认为你可以使用Pandas

import pandas as pd
df = pd.read_csv(csv_file_path)
print(df)

最新更新