Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df["new_col"] = np.where(df[["col1", "col2", "col3", "col4", "col5", "col6", "col7"]]>0,1,0)
- Wrong number of items passed 7, placement implies 1
- 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