I have three 2D arrays each, each of shape [180 x 360]
I want make a new array which contains only regions with the maximum of each array compared to the other two.
# Assuming these are my 2D arrays A = np.array([[2, 6], [4, 2]]) B = np.array([[1, 4], [5, 2]]) C = np.array([[5, 4], [8, 4]]) # Trying to get the maximum regions when compared to the two arrays AA = np.logical_and(A>B, A>C) BB = np.logical_and(B>A, B>C) CC = np.logical_and(C>A, C>B) # in this case AA shoud be new array like this AA = [False,True][False,False] Problem here is that the reuslts I get overlap. I expect AA, BB, CC to be unique given the fact that each of them represent maximum of the other two. How can I make this right?
Thanks
np.maximum(A, np.maximum(B, C))?