[英]how to fill blank of column from one data frame to another?
i have a 2 dataframe, i wanted to fill the ID column blank with help first column ID.我有一个 2 dataframe,我想在第一列 ID 的帮助下填写 ID 列空白。 The data is not Identical the second data is having less number of entry.数据不相同,第二个数据的条目数较少。 And I have to find the id values with respect to the C_name column.而且我必须找到与 C_name 列相关的 id 值。 If C_Name and I'd of 1st data is equal to the 2rd data value the value from 1 data should come to 2 data frame如果第一个数据的 C_Name 和 I 等于第二个数据值,则来自 1 个数据的值应该来自 2 个数据帧
C_Name ID item ID
Ad ADV01 ADV001
NC 899 NC01
NC 899 NC01
Med 14996 0-A
Bank 20668 BNK002
Light LIG01 LIG01
Light LIG01 LIG03
Light LIG01 LIG03
Light LIG01 LIG03
Ad ADV01 AD01
Ivar's IVARS01 I01
Ad ADV01 AD01
Light LIG01 LIG03
OneNet ONT01 ONENET001
Light LIG01 LIG03
Tri CAL01 201-TP
Tri CAL01 201-SPK
Tri CAL01 201-CHI
Light LIG01 2059
Light LIG01 2059
Light LIG01 2059
Light LIG01 2059
Light LIG01 2059
Distribution DMSI01 2052
second data第二数据
C_Name ID item ID
Ad ADV01 ADV001
NC 899 NC01
NC NC01
Med 14996 0-A
Bank 20668 BNK002
Light LIG01 LIG01
Light LIG03
Light LIG03
Light LIG03
Ad ADV01 AD01
Ivar's IVARS01 I01
Ad ADV01 AD01
Light LIG01 LIG03
OneNet ONT01 ONENET001
Light LIG01 LIG03
Tri CAL01 201-TP
Tri 201-SPK
Tri 201-CHI
Light LIG01 2059
Light 2059
Light 2059
Light 2059
Light 2059
Distribution DMSI01 2052
how should i do it?我该怎么做?
You can use series.update(other) as您可以使用series.update(other)作为
df2.ID.upadte(df1.ID)
Careful with小心翼翼
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.