我有一个数据框df1
Name Cluster Centroid
Ann 1 (1,2)
Josh 2 (3,4)
Drake 3 (5,6)
和另一个数据框df2
Name
Ann
Josh
Drake
Ann
Drake
nan
Josh
如何根据df1中的匹配名称(在nan中考虑)在df2中创建簇和质心列?无需重复
所以我想要df2:
Name Cluster Centroid
Ann 1 (1,2)
Josh 2 (3,4)
Drake 3 (5,6)
Ann 1 (1,2)
Drake 3 (5,6)
nan nan nan
Josh 2 (3,4)
谢谢!