consider the arrays a
and b
np.random.seed([3,1415])
a = np.random.choice(np.arange(100), (2, 10), False)
b = np.random.choice(np.arange(100), (2, 10), False)
a.sort(1)
b.sort(1)
print(a, '\n' * 2, b)
[[ 3 20 21 46 47 61 80 83 88 94]
[ 1 16 32 33 40 48 57 59 69 84]]
[[32 38 44 50 52 63 68 82 93 95]
[ 3 25 27 37 57 62 71 78 85 86]]
I can do a np.searchsorted
of b[0]
on a[0]
print(a[0].searchsorted(b[0]))
[ 3 3 3 5 5 6 6 7 9 10]
But how do I do all rows at once?