# -*- coding: utf-8 -*-import pandas as pdimport tushare as tsfrom sqlalchemy import create_engineengine = create_engine('mysql://root:123456@127.0.0.1/quant?charset=utf8')quant_top_inst = pd.read_sql('select * from quant_top_inst',engine)quant_top_inst.drop_duplicates(keep='last',inplace=True)quant_top_inst.to_sql('quant_top_inst',engine,if_exists='append',index=False)
来源:https://www.cnblogs.com/Iceredtea/p/12199436.html