Skip to content

Instantly share code, notes, and snippets.

Created April 14, 2020 04:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import pandas as pd
import sqlite3
# read csv files
df_train = pd.read_csv('./train_food/train.csv')
df_meal = pd.read_csv('./train_food/meal_info.csv')
df_center = pd.read_csv('./train_food/fulfilment_center_info.csv')
# connect to database
conn = sqlite3.connect('.\sql_db\FOOD.db')
cur = conn.cursor()
# load dataframes into database
df_train.to_sql("train", conn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment