To do this, you need to find the array index of the element that has the value closest to v , like so: idx = (np.abs(arr - v)).argmin().
確定! 回上一頁