pandas python 读取大文件
data = pd.read_csv('*****.csv',iterator=True) loop = True chunkSize = 1000000 chunks = [] while loop: try: chunk = data.get_chunk(chunkSize) #break chunk = chunk[['companyId:ID(Company-ID)',':LABEL','company_name']] chunk.to_csv(path,index=False,mode='a',header=0) except StopIteration: loop = False print("Iteration is stopped.") #df = pd.concat(chunks, ignore_index=True) chunk.head()