numpy multiple if in case statements

前端 未结 0 1076
猫巷女王i
猫巷女王i 2021-01-28 09:58

Hi all I am trying to add a column in my DF based on the value of another column.

df[\'new_col\'] = np.where(If df.col in [3, 4, 5] then 1 
                               


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题