Suppose I have a numpy array
A = [[1 2 3] [2 3 3] [1 2 3]]
and another array
B = [[3 2 3] [1 2 3] [4 6 3]]
and an array of true values:
C = [[1 4 3] [8 7 3] [4 10 3]]
Now I want to create an array D, the elements of which will depend on A or B, and the condition is the closest value to each element from the array C.
Is there any pythonic way to do this? Im is using loops right now
source share