pyinterp.Axis.find_indexes

pyinterp.Axis.find_indexes#

Axis.find_indexes(self, coordinates: numpy.ndarray[dtype=float64, shape=(*), writable=False]) numpy.ndarray[dtype=int64, shape=(*, 2), order='C']#

Find indexes of axis elements surrounding each coordinate.

For each coordinate in the input array, find the indexes i0 and i1 such that self[i0] <= coordinate <= self[i1]. Coordinates outside the axis range are set to -1.

Parameters:

coordinates – Positions in this coordinate system.

Returns:

A matrix of shape (n, 2). The first column contains the indexes i0 and the second column contains the indexes i1 found.