def write_to_db(engine, frame, table_name, chunk_size):
    for idx, chunk in enumerate(chunks(frame, chunk_size)):
        if idx == 0:
            pass
Python Pandas - Using to_sql to write large data frames in chunks