使用 pandas Python (pandas.io.parsers.TextFileReader) 从文件中读取数据时出现问题

Problem reading a data from a file with pandas Python (pandas.io.parsers.TextFileReader)

我想用 pandas 从文件中读取数据集,但是当我使用 pd.read_csv() 时,程序会读取它,但是当我想看到数据框时出现:

pandas.io.parsers.TextFileReader 在 0x1b3b6b3e198

作为附加信息,文件太大(大约 9 Gigas)

该文件使用垂直线作为分隔符,我尝试使用 chunksize 但它不起作用。

import pandas as pd
df = pd.read_csv(r"C:\Users\dguerr\Documents\files\Automotive\target_file", iterator=True, sep='|',chunksize=1000)

我想以传统的 pandas 数据帧格式导入我的数据。

您可以通过以下方式逐块加载它:

import pandas as pd

path_to_file = "C:/Users/dguerr/Documents/Acxiom files/Automotive/auto_model_target_file"
chunk_size = 1000
for chunk in pd.read_csv(path_to_file,chunksize=chunk_size):
     # do your stuff