I have an list of lists :
[[0, 2], [1, 3], [2, 5], [3, 2], [4, 5]]
and a value in a list, for example : [4,0]
Imagine this to be xy-grid and i would like to find the closest value in the list of lists as possible.
I have looked here Find nearest value in numpy array
more exactly this line : idx = np.array([np.linalg.norm(x+y) for (x,y)
in array-value]).argmin()
The problem is that it sum up x+y, so it would say that [1,3] is the closest one and it could be true in some cases but not all and in this specific case [3,2] is closer.
Please help.