Created
April 14, 2020 04:54
-
-
Save aniruddha27/b31995e1ff9c12448f77e41c3c7c97f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
df_meal.to_sql('meal',conn) | |
df_center.to_sql('centers',conn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment