python读取几个G的csv文件方法
如下所示:
import pandas as pd file = pd.read_csv('file.csv',iterator=True) while True: chunk = file.get_chunk(1000) print(chunk.head(10)) print(chunk.tail(10))
如下所示:
import pandas as pd file = pd.read_csv('file.csv',iterator=True) while True: chunk = file.get_chunk(1000) print(chunk.head(10)) print(chunk.tail(10))