mercredi 2 mars 2016

Join on two SQLite databases python/pandas

I'm new to Python/Pandas and SQLite. After browsing other stackoverflow help, I've created a few large SQLite databases by uploading csv files (3GB+ each). Want to do a join and the way I saw on here appears to not allow this. Is there a way to do it in this construct? Should I have uploaded multiple tables into a single SQLite database? Thanks in advance.

Assume my databases are

foo.db  
bar.db

For a single query of a single database I have the following (works):

import pandas as pd
from sqlalchemy import create_engine
import datetime as dt
from IPython.display import display


disk_engine = create_engine('sqlite:///foo.db')

df = pd.read_sql_query('SELECT * FROM data', disk_engine)

Aucun commentaire:

Enregistrer un commentaire