from sqlalchemy import create_engine
import pandas as pd
engine=create_engine('sqlite:///localdb.sqlite')
df = pd.read_csv('./output.csv')
#pd.io.sql.to_sql(df,'test',con=engine,if_exists='append', index=False)
df.to_sql('test', con=engine, if_exists='replace')
df=pd.read_sql_query("select * from test",engine)
PYTHON使用SQLALCHEMY
最新推荐文章于 2023-10-20 17:27:16 发布