尝试使用.loc和.fillna
df.loc[((df['Value_1'] > 1000) |(df['Value_2'] > 15000)), 'High_Value_Ind'] = 'Y'df['High_Value_Ind'] = df['High_Value_Ind'].fillna('N')
欢迎分享,转载请注明来源:内存溢出
尝试使用.loc和.fillna
df.loc[((df['Value_1'] > 1000) |(df['Value_2'] > 15000)), 'High_Value_Ind'] = 'Y'df['High_Value_Ind'] = df['High_Value_Ind'].fillna('N')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)