파이썬에서 dataframe to postgresql 저장하기
import sqlalchemy from sqlalchemy import create_engine engine = sqlalchemy.create_engine("postgresql://user:password@host:port/database") df_tp.to_sql(name = 'tablename', con = engine, schema = 'public', if_exists = 'replace', # {'fail', 'replace', 'append'), default 'fail' index = True, index_label = 'id', chunksize = 2, dtype = { 'id': sqlalchemy.types.INTEGER(), 'dominant': sqlalchemy.INTEGER..
2021. 11. 21.