读取所有列的话cols = all
def r_file(file,cols):
list1=[]
for part in pd.read_csv(file,usecols=cols,chunksize=50000):
list1.append(part)
df=pd.concat(list1)
del list1
del part
return df
def python_read(filename):
with open(filename,'r',encoding='utf-8') as f:
while True:
line = f.readline()
if not line:
return
yield line