📅  最后修改于: 2022-03-11 14:46:09.679000             🧑  作者: Mango
# Option 1
df['concat'] = np.where(df['var_1'] == '', df['var_2'], df['var_1'] + '_u')
# Option 2
def concat_fields(field1, field2):
if field1.empty:
return field2
else:
return field1 + '_u'