pandas.io.sql.write_frame

pandas.io.sql.write_frame(frame, name, con, flavor='sqlite', if_exists='fail', **kwargs)

Write records stored in a DataFrame to a SQL database.

Parameters :

frame: DataFrame

name: name of SQL table

con: an open SQL database connection object

flavor: {‘sqlite’, ‘mysql’, ‘oracle’}, default ‘sqlite’

if_exists: {‘fail’, ‘replace’, ‘append’}, default ‘fail’

fail: If table exists, do nothing. replace: If table exists, drop it, recreate it, and insert data. append: If table exists, insert data. Create if does not exist.