index

ompy.index(double[:] array, double element)

Finds the index of the closest element in the array

Unsafe. 9 times faster than np.abs(array - element).argmin()

Parameters
  • array – The array to index

  • element – The element to find

Returns

The index (int) to the closest element in the array.