In python how would I do this:
say I have:
a = [[1, 5], [2,6], [3,3], [4,2]]
b= [[3, 1], [4,2], [1,8], [2,4]]
Now I want to do an operation with the second column values IF the first column values match.
E.G.
a has an entry [1,5], now go through b to see oh it has a value [1,8], now I want to divide 5/8 and store that value into say array c. Next would be matching [2,6] and [2,4] and getting the next value in c: 6/4.
so:
c = [5/8, 6/4, 3/1, 2/2]
Given the above example. I hope this makes sense. Would like to this with numpy and python.
aalways sorted? Do every first-column number inaappear inb? Are they of the same size?