basedf=pd.read_sql(sqlstr,conn)
xpowerdf=pd.read_sql(sqlstr,conn)
basedf=pd.merge(basedf, xpowerdf, on='ifIndex',how='left')
转换nan 缺失数据
basedf=basedf.fillna(0)
翻译
result_list = []
rest = basedf.values.tolist()
for item in rest:
dic_a = dict(zip(kes,item))
result_list.append(dic_a)
转换成[{'a':1,'b':2},{'a':1,'b':2}]
网友评论