import pandas as pd
data = pd.DataFrame({ 'id' : [1,2,3,4], 'text' : ['Sample1', 'Sample2', 'Sample3', 'Sample4'] })
data
id text
0 1 Sample1
1 2 Sample2
2 3 Sample3
3 4 Sample4
I have a dataframe created in a python program. I am using psycopg2
to connect to a Postgres database
. Is there any way I can directly create a table in postgres using this dataframe in python as a reference?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…