Created
December 6, 2022 01:22
-
-
Save dazza-codes/16ee59269a030d01e9c16b6036b24ccc to your computer and use it in GitHub Desktop.
Pandas CSV to SQL
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
#!/usr/bin/env python | |
import pandas as pd | |
from sqlalchemy import create_engine | |
engine = create_engine('sqlite://', echo=True) | |
df = pd.read_csv("/tmp/input.csv") | |
df.to_sql('input', con=engine) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment