ref: Pandas新增一列并按条件赋值?
把下图中的 NaN 都赋值为 0
df.loc[条件判断, 'value'] = 0
m = pd.merge(gdf_africa, df_af_mp, how='left', on='country')
m.loc[m['value'].isna(), 'value'] = 0
m
标签:loc,df,864,value,dataframe,pandas,赋值 From: https://www.cnblogs.com/alex-bn-lee/p/17568297.html