pandas df入库
from sqlalchemy import create_engine
##gp数据库连接
db_gp = create_engine('postgresql://gpadmin:gpadmin@loaclhost:2345/postgres')
##pg数据库链接
db_pg = create_engine('postgresql://postgres:12345@localhost:5432/postgres')
conn=db_pg .connect()
##if_exit=replace 如果表存在,清空原表数据
##if_exit=append 如果表存在,插入数据
news_df.to_sql("table_name", conn, if_exists= "append",index=False)