合并新列
字符串类型:
df['NEW_ADDRESS']=df['PROVINCE_NAME']+df['CITY_NAME']+df['AREA_NAME']+df['ADDRESS']
非字符串类型:
df.loc[df['PROVINCE_NAME'].notnull(),'NEW_ADDRESS']=df['PROVINCE_NAME'].map(str)+df['CITY_NAME'].map(str)+df['AREA_NAME'].map(str)+df['ADDRESS'].map(str)
df.loc[df['PROVINCE_NAME'].isnull(),'NEW_ADDRESS']=df['ADDRESS']
网友评论