I'm trying to compare two lists and replace the values of the first one by the values of the second one only if they are smaller.
I tried the smaller than function from python but this seems to replace the whole list.
A = [7 , 10 , 2, 5 , 9]
B = [8 , 12 , 1, 4 , 7]
A[A < B] = B
This replaces list A by list B, probably because it compares the whole list. I would want only the values replaced that are smaller than the ones in B resulting in:
[8 , 12 , 2 , 5 , 9]
A[A<B] = Bdoesn't just assignBtoA[1]?