首页 > 编程知识 正文

iphone 11数据迁移到iphone 13,python 怎么从dataframe中取数

时间:2023-05-06 06:59:41 阅读:241042 作者:3206

亲测好用,看代码 from sqlalchemy import create_engine,typesengine = create_engine('oracle://ycr:ycr123@192.168.100.10:1521/stock')#设置写入类型,不然默认是用CLOB类型写入,内置的类型转换很慢,小量数据无所谓dtyp = {c:types.VARCHAR(df[c].str.len().max()) for c in df.columns[df.dtypes == 'object'].tolist()}#不设置to_sql的方法,设置写入类型df.to_sql(t_name, con=engine, if_exists='append', index=False, index_label=None, dtype=dtyp)#关闭引擎engine.dispose()

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。