Using Python, consider an array X
containing 2d data:
X = np.array([x0,y0], ..., [xn,yn])
and three 1d arrays Y_A, Y_B, Y_C
of same length as X
containing numbers. Finally consider 3 empty arrays A,B,C
. How can I fill these empty arrays A,B,C
according to the following pseudo-code?
Pseudo-code:
for each i in range(X):
if Y_A[i] > Y_B[i] and Y_A[i] > Y_C[i]
store X[i] to array A
else if Y_B[i] > Y_A[i] and Y_B[i] > Y_C[i]
store X[i] to array B
else store X[i] to array C
My effort which does not work:
for each i in range(len(X)):
if Y_A[i] > Y_B[i] and Y_A[i] > Y_C[i]:
A = Y_A
if Y_B[i] > Y_A[i] and Y_B[i] > Y_C[i]:
B = Y_B
else:
C = Y_C