i have a nested list with some values and 1 list of minimum values in that each list of list. I want to find index value of that minimum value in list of list.
i have list of list like that-
distances=[[6.75, 0.75, 0.25, 2.25, 2.75, 1.75, 5.75, 2.75, 3.75, 7.75], [1.833333333333333, 4.166666666666667, 5.166666666666667, 7.166666666666667, 2.166666666666667, 3.166666666666667, 0.833333333333333, 2.166666666666667, 1.166666666666667, 2.833333333333333]]
list of minimum values in above list-
minimum_distance= [0.25, 0.833333333333333]
i have tried below code- but
def find(c):
for i, distance in enumerate(distances):
try:
j = distance .index(c)
except ValueError:
continue
yield i, j
matches = [match for match in find(k for k in minimum_distance)]
print(matches)
resultant list is empty, i want like [(1,6)]