def valid(chunks):
    for chunk in chunks:
        mask = chunk['B'] < 10
if mask.all():
    yield chunk
else:
    yield chunk.loc[mask]
break
chunksize = 10 ** 5
chunks = pd.read_csv(filename, chunksize=chunksize, header=None)
df = pd.concat(valid(chunks))
conditional row read of csv in pandas