我习惯了 R,它提供了逐列读取 CSV 文件的快速功能,任何人都可以提出一种快速有效的方法来读取 python 中的大数据(例如 CSV)文件吗?例如 CSV 文件的第i列。
我有以下但需要时间:
import os,csv, numpy, scipy
from numpy import *
f= open('some.csv', 'rb')
reader = csv.reader(f, delimiter=',')
header = reader.next()
zipped = zip(*reader)
print( zipped[0] ) # is the first column
有没有更好的方法在 python 中读取数据(从大文件中)(至少在内存方面和 R 一样快)?