import numpy as np import pandas as pd
def read_csv_into_numpy(filename, chunksize): data = pd.read_csv(filename, chunksize=chunksize) np_array = np.concatenate([chunk.values for chunk in data]) return np_array
filename = 'data.csv' chunksize = 1000 np_array = read_csv_into_numpy(filename, chunksize) print(np_array)
上一篇:昂达小马31刷centos7