I'm stuck. I have a pandas dataframe with j columns, each column containing 1000 values, each column represents a day. I have another array of individual values, each corresponding to expected values for each day.
I would like to find out how many values in each column are greater than the value of the previous day.
DF:
D1 D2 D3
5 6 9
10 2 1
3 9 2
Array:
(2, 4, 5)
for column D2, what proportion of values are greater than 2? for column D3, what proportion of values are greater than 4, for column D4 (not shown), what proportion of values are greater than D3, and so on...
in this case, it would by 66% (2/3) for D2, and then 33% (1/3) for D3.
Any help is appreciated. Thank you!