Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. df["new_col"] = np.where(df[["col1", "col2", "col3", "col4", "col5", "col6", "col7"]]>0,1,0)
  2.  
  3. Wrong number of items passed 7, placement implies 1
  4.  
  5. df["new_col"] = df[["col1", "col2", "col3", "col4", "col5", "col6", "col7"]].all(axis=1).astype(int)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement