根据查找值填充数据框列

时间:2019-02-15 17:11:46

标签: python-3.x pandas

如何在这种情况下填充数据框列:

if column "id" in df1 has a value which is in column "id" of df2:
   df1[new col] = df2["an existing column of the second df"]
else:
   df1[new col] = 0

0 个答案:

没有答案