Johan Nilssons Lifestream

Compare multiple row values

I want to compare for each row, values of A with the other columns

The problem is more complex but i tried to simplify it in this table:

     A    B    C  D
0  1.3  1.0  1.1  1
1  2.5  2.9  2.6  3
2  3.1  3.0  3.2  2

The result should look like this:

Here in index 0: 1.3 is larger than the values in B,C and D, then we return 1, otherwise it is 0

     A    B    C  D  result
0  1.3  1.0  1.1  1       1
1  2.5  2.9  2.6  3       0
2  3.1  3.0  3.2  2       0

Thank you in advance

via Stack Overflow

blog comments powered by Disqus
Get the source for phplifestream at Github