Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
read a large csv file and subset on datetime column
from dateutil.parser import parse
with open('data.csv') as fin:
for line in csv.reader(fin):
date1 = parse(row[1])
date2 = datetime.now() - timedelta(days=3)
if date1 > date2:
continue
process(row) # whatever your logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.