if len(dilist)>0:
dilist_one=dilist[0]
outdf=pd.merge(outdf, dilist_one, on='equ_id',how='left')
if len(dilist)>1:
dilist = dilist[1::]
for x in dilist:
outdf=pd.merge(outdf, x, on=['equ_id','start_time'],how='left')
if len(dilist)>0:
dilist_one=dilist[0]
outdf=pd.merge(outdf, dilist_one, on='equ_id',how='left')
if len(dilist)>1:
dilist = dilist[1::]
for x in dilist:
outdf=pd.merge(outdf, x, on=['equ_id','start_time'],how='left')
本文标题:pd.merge 多字段合并
本文链接:https://www.haomeiwen.com/subject/hqjgzftx.html
网友评论