Skip to content

Instantly share code, notes, and snippets.

@maxcraftsman
Last active July 7, 2020 12:07
Show Gist options
  • Save maxcraftsman/6c9eee873598e1fddab228192f14d505 to your computer and use it in GitHub Desktop.
Save maxcraftsman/6c9eee873598e1fddab228192f14d505 to your computer and use it in GitHub Desktop.
Save pandas to sqlite [dirty]
import pandas as pd
import sqlalchemy as sa
e = sa.create_engine(r'sqlite:////path/to/file/database.db', echo=True) # LINUX
e = sa.create_engine(r'sqlite:///C:\\path\\to\\database.db', echo=True) # WINDOWS
df.to_sql("deskykt", e, if_exists="append", index=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment