# credit to the Stack Overflow user in the source link for chunk in pd.read_sql_query(sql_str, engine, chunksize = 10): do_something_with(chunk)