python get index of nearest value in list