<p>还有一种方法:</p>
<pre><code>s=df2.set_index('name')['total_points']
final=df1.assign(**pd.DataFrame(np.where(df1.isin(s.index),df1.replace(s),np.nan)
,columns=df1.columns.str[-1]).add_prefix('total_points'))
print(final[sorted(final.columns,key=lambda x: x[-1])])
</code></pre>
<hr/>
<pre><code> secondBoxer1 total_points1 secondBoxer2 total_points2 secondBoxer3 \
0 Cody NaN Tamis NaN Davin
1 Billy 27.5 Danye NaN Delbert
2 Jennifer NaN Leesa NaN Kanisca
3 Franc NaN Hector 50 Luis
4 Mark NaN Coy NaN nan
total_points3 secondBoxer4 total_points4 secondBoxer5 total_points5 \
0 NaN Caro NaN Caro NaN
1 NaN John 48 Ryan NaN
2 NaN nan NaN nan NaN
3 31.875 Jose 30 Jose 30
4 NaN nan NaN nan NaN
secondBoxer6 total_points6
0 nan NaN
1 nan NaN
2 nan NaN
3 Luis 31.875
4 nan NaN
</code></pre>