This is a follow-up post to a previous question of mine:
Check whether numpy array row is smaller than the next
Suppose i have the following numpy array:
a=np.reshape(np.array([[79,np.nan,87,77,92,133,99,121,103,118,126,
133,131,67]]),(7,2))
In [1]: a
Out[1]:
array([[ 79., nan],
[ 87., 77.],
[ 92., 133.],
[ 99., 121.],
[ 103., 118.],
[ 126., 133.],
[ 131., 67.]])
I would like to create a new column or array which will be a True/False indicator testing the following proposition:
a[-1, 0] < a[1:, 0] and a[-1, 1] > a[1:, 1]
The result that i expect is the following:
False (because the first value of column 1 is nan)
False
True
True
False
True
False
I have tried different variations of the solutions described in my previous post, but so far i have been unsuccessful.
EDIT:
The idea is to test whether 87<92 and at the same time 77>133 which is False. Then 92<99 and 133>121 which is True etc.
Falsebecause 131 (a[-1,0]) is>every other value in that column. Same for col 2. Can you please explain your proposition more exactly?