I like to count elements in columns 1 to 3 that are greater than elements in column 0. For example, I have a dataframe as below.
a b c d
0 50 60 40 20.0
1 40 10 30 40.0
2 30 40 20 35.0
3 20 0 30 25.0
4 10 5 40 NaN
And I want to count elements in columns b,c,d that are greater than element in column a. So the result should be as below.
a b c d count
0 50 60 40 20.0 1
1 40 10 30 40.0 0
2 30 40 20 35.0 2
3 20 0 30 25.0 2
4 10 5 40 NaN 1
Thank you for the help in advance.