Например:
Код: Выделить всё
import numpy as np
A = np.array([ 1, 48, 50, 78, 85, 97])
B = np.array([38, 43, 50, 62, 78, 85])
Код: Выделить всё
C = [2,3,4] # since 50 in second array occurs in first array at index 2,
# similarly 78 in second array occurs in first array in index 3,
# similarly for 85, it is index 4
Код: Выделить всё
accuracy = np.searchsorted(A, B)
Подробнее здесь: https://stackoverflow.com/questions/289 ... ther-array