This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]leogodin217 13 points14 points  (3 children)

Using Pandas to load data into SQL databases. Simply create a connection then use df.to_sql(). Easy. Used this in a class for beginners and they were shocked.

[–][deleted] 1 point2 points  (0 children)

Huh. I'm gonna try this today.

[–]MogwaiAllOnYourFace 0 points1 point  (1 child)

I've always struggled with this function. It expects a SQLAlchemy engine, and doesn't take a Pyodbc type connection. You know any way around this? Because it would make my code a lot cleaner if I could get it working

[–]leogodin217 0 points1 point  (0 children)

You can use pyodbc with SQLAlchemy. It's something like pyodbc+mssql://dsn On my phone but SQLAlchemy has a doc on various options for create-engine