Export Data
General Info
Useful Snippets

3.0.5 Export a dataframe to a database table

Example:

import pandas as pd
import sqlite3

conn = sqlite3.connect('/path/to/your/sqlite.db')    # This example uses SQLite, change to something else if needed

DF.to_sql('TableName'
              , con=conn.            # your database connection 
              , if_exists='replace' # replaces DB table if it currently exists - change to 'append' to add rows to an existing table
              , index_label='id'     # specify what you'd like your ID column to be named in your DB table
               )