为什么 python pd.read_csv 无法读取整个数据?

问题描述 投票:0回答:1

我使用 python pd.read_csv 读取大约 5,000,000 行的基因深度数据,但 python 只读取 1,000,000 行。 数据文件约125M。 问题是什么?我该怎么做才能读出整个数据文件。

我使用read_csv在在线jupyter lab web中读取数据,上传数据并读取数据。 我无法使用 read_csv 函数读取数据。 我应该使用R语言吗?或者还有其他方法吗?

python jupyter data-processing
1个回答
0
投票

默认情况下,使用

pd.read_csv()
时 pandas 仅加载前 1000 行。您需要指定 nrows 参数以强制其读取整个文件:

df = pd.read_csv('data.csv', nrows=5000000)

© www.soinside.com 2019 - 2024. All rights reserved.