Reputation: 778
Is it possible to write a Pandas dataframe to PostgreSQL database using psycopg2?
Endgoal is to be able to write a Pandas dataframe to Amazon RDS PostgreSQL instance.
Upvotes: 7
Views: 11583
Reputation: 8270
If you use a SQLAlchemy engine around psycopg2, you could probably use df.to_sql
. See: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_sql.html
Upvotes: 2