I have two lists:
a = [[9, 5], [9, 10000], [9, 10000], [5, 10000], [5, 10000], [10001, 10], [10001, 10]]
b = [19144.85, 8824.73, 26243.88, 23348.02, 40767.17, 55613.43, 40188.8]
I am trying to remove the repeated coordinates in a and remove the adjacent value in b but by leaving the smallest value. So for example coordinate [9,10000] is repeated twice with values in b of 8824.73 and 26243.88 the result should be two lists where there is only one [9,10000] with the smaller of b which is 8824.73.
So overall the result should look like:
aa = [[9,5],[9,10000],[5,10000],[10001,10]]
bb = [19144.85, 8824.73, 23348.02, 40188.8]
I am finding it difficult to formulate the problem and iterate through the lists and I am not sure how I can use the zip function. Any help is appreciated!