Consider the lists below
filters= [u, i, g, r, z]
result = [None, 34, None, None, 45]
the items in the result are computed for each filter in filters. It happens that filters, u, g, z did not return any results. So i would to re-compute the values of result[0], result[2], result[4], using the filters that returned values.
My problem is iterating through both lists and using the closet filter to compute a value missing in result.
e.g result[0] should be computed using 'i' (i is closest to u) result[2] we also use 'i' not 'z' and result[3] we use 'z'. How to generalize this?? (filters are fixed, but items in values keep changing.) What i would like to get is a tuple with two filters, (filter_missing_a_value_in_results, filter_to_used_to_computer_the_missing_value)
result[2]ifresult[3]were populated?