I have a df
col1 col2 col3 col4
0 1 2 3 4
1 2 2 3 4
2 3 4 3 5
3 4 3 2 1
And I want to add a new column based on:
if (col1 & col2) < (col3 & col4) --- > 2
I followed the approach similar to this post, just without max()
as follow but all didn't work:
df[['col1','col2']] < df[['col3','col4']]
(df['col1'] and df['col2']) < (df['col3'] and df['col4'])
What's the correct way to do it? Thanks.